getObjectsFix

return empty array if keys is empty or not an array
This commit is contained in:
barisusakli
2014-09-22 21:47:20 -04:00
parent 39392672a2
commit 515e663f85
2 changed files with 5 additions and 1 deletions

View File

@@ -40,6 +40,10 @@ var async = require('async'),
return callback(err);
}
if (!Array.isArray(notifications) || !notifications.length) {
return callback(null, []);
}
async.map(notifications, function(notification, next) {
if (!notification) {
return next(null, null);