Skip to content

Node.js based forum software built for the modern web

minor fix to prevent err when trying to mark null nid

barisusaklib0b78c3092bc
diff --git a/src/messaging.js b/src/messaging.js
index 4563a3a12d..7d7018d388 100644
--- a/src/messaging.js
+++ b/src/messaging.js
@@ -92,7 +92,7 @@ var db = require('./database'),
return callback(err);
}
- if (!mids || !mids.length) {
+ if (!Array.isArray(mids) || !mids.length) {
return callback(null, []);
}
diff --git a/src/notifications.js b/src/notifications.js
index 655851d480..4d03e22140 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -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();
}