From b493b81dbdeaaad4443ec67e1745224024e49d54 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 5 May 2016 21:00:15 +0300 Subject: [PATCH] fix crash if category or children is invalid --- public/src/modules/helpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index fda87711fb..7250fab3b6 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -103,7 +103,9 @@ helpers.generateChildrenCategories = function(category) { var html = ''; var relative_path = (typeof config !== 'undefined' ? config.relative_path : require('nconf').get('relative_path')); - + if (!category || !category.children) { + return html; + } category.children.forEach(function(child) { if (!child) { return;