This commit is contained in:
barisusakli
2014-09-19 18:59:11 -04:00
parent 630977fb99
commit 59120df71c
2 changed files with 6 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ Controllers.home = function(req, res, next) {
childCategories.push.apply(childCategories, categoryData[i].children);
}
if (categoryData[i].parent) {
if (categoryData[i].parent && categoryData[i].parent.cid) {
categoryData.splice(i, 1);
}
}

View File

@@ -33,6 +33,11 @@ module.exports = function(db, module) {
module.setsAdd = function(keys, value, callback) {
callback = callback || helpers.noop;
if (!Array.isArray(keys) || !keys.length) {
return callback();
}
if(!Array.isArray(value)) {
value = [value];
}