From 96c44eec38538475a1cb17cd304f8ac751ba8b4b Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 21 Feb 2017 14:48:21 +0000 Subject: [PATCH] Support values other than objects in the numKeys filter, returning zero if so. --- .../public/coffee/ide/review-panel/filters/numKeys.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/review-panel/filters/numKeys.coffee b/services/web/public/coffee/ide/review-panel/filters/numKeys.coffee index 4a37638c1e..c1822d02c9 100644 --- a/services/web/public/coffee/ide/review-panel/filters/numKeys.coffee +++ b/services/web/public/coffee/ide/review-panel/filters/numKeys.coffee @@ -2,4 +2,8 @@ define [ "base" ], (App) -> app.filter "numKeys", () -> - (object) -> Object.keys(object).length + (object) -> + if object? + return Object.keys(object).length + else + return 0