fix crash if category or children is invalid

This commit is contained in:
barisusakli
2016-05-05 21:00:15 +03:00
parent 22e7f83564
commit b493b81dbd

View File

@@ -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;