From 4e8918818ab4ea66380fb0e8c6b349697c7c372c Mon Sep 17 00:00:00 2001 From: negue Date: Thu, 21 May 2015 23:24:10 +0200 Subject: [PATCH] fix(pushNotifications): user null check #5252 --- website/src/controllers/pushNotifications.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/src/controllers/pushNotifications.js b/website/src/controllers/pushNotifications.js index 98ec0b5d82..d0d98b5218 100644 --- a/website/src/controllers/pushNotifications.js +++ b/website/src/controllers/pushNotifications.js @@ -27,6 +27,11 @@ if(gcm){ api.sendNotify = function(user, title, msg, timeToLive){ timeToLive = timeToLive || 15; + // need investigation: + // https://github.com/HabitRPG/habitrpg/issues/5252 + if(!user) + return; + _.forEach(user.pushDevices, function(pushDevice){ switch(pushDevice.type){ case "android":