minor fix to prevent err when trying to mark null nid

This commit is contained in:
barisusakli
2014-08-03 12:40:46 -04:00
parent 214f6af324
commit b0b78c3092
2 changed files with 2 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ var db = require('./database'),
return callback(err);
}
if (!mids || !mids.length) {
if (!Array.isArray(mids) || !mids.length) {
return callback(null, []);
}

View File

@@ -214,7 +214,7 @@ var async = require('async'),
Notifications.markRead = function(nid, uid, callback) {
callback = callback || function() {};
if (!parseInt(uid, 10)) {
if (!parseInt(uid, 10) || !parseInt(nid, 10)) {
return callback();
}