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":