FIX: handle missing users when sending push notifications

This commit is contained in:
Arpit Jalan 2018-05-17 12:52:01 +05:30
parent 17a7bb8e23
commit 238a13643d

View File

@ -1,8 +1,8 @@
module Jobs module Jobs
class SendPushNotification < Jobs::Base class SendPushNotification < Jobs::Base
def execute(args) def execute(args)
user = User.find(args[:user_id]) user = User.find_by(id: args[:user_id])
PushNotificationPusher.push(user, args[:payload]) PushNotificationPusher.push(user, args[:payload]) if user
end end
end end
end end