Skip to content

Node.js based forum software built for the modern web

if notif is deleted don't push, prevent crash

barisusakli62681c36efa2
diff --git a/src/notifications.js b/src/notifications.js
index 818f89f338..ea96fda52d 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -160,6 +160,10 @@ var async = require('async'),
};
function shouldPush(uid, newNotifObj, callback) {
+ if (!newNotifObj) {
+ return callback(null, false);
+ }
+
hasNotification(newNotifObj.uniqueId, uid, function(err, hasNotification) {
if (err) {
return callback(err);