minor fix to prevent err when trying to mark null nid

v1.18.x
barisusakli 11 years ago
parent 214f6af324
commit b0b78c3092

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

@ -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();
}

Loading…
Cancel
Save