fix(pushNotifications): user null check

#5252
This commit is contained in:
negue 2015-05-21 23:24:10 +02:00
parent ee4df15b71
commit 4e8918818a

View file

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