From 26b2ef154362326776d39a3d5d2a24511a727d5e Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 16 Dec 2014 14:46:02 -0500 Subject: [PATCH] prevent crash in getChildren --- src/categories.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/categories.js b/src/categories.js index eb65878864..c5078d711a 100644 --- a/src/categories.js +++ b/src/categories.js @@ -288,7 +288,7 @@ var async = require('async'), // Filter categories to isolate children, and remove disabled categories async.map(cids, function(cid, next) { next(null, categories.filter(function(category) { - return parseInt(category.parentCid, 10) === parseInt(cid, 10) && !category.disabled; + return category && parseInt(category.parentCid, 10) === parseInt(cid, 10) && !category.disabled; })); }, next); }