From 62681c36efa2a07f6319cd19c8f0806ff82c71c0 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 2 Aug 2014 15:10:32 -0400 Subject: [PATCH] if notif is deleted don't push, prevent crash --- src/notifications.js | 4 ++++ 1 file changed, 4 insertions(+) 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);