Skip to content

Node.js based forum software built for the modern web

fix crash if category or children is invalid

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