]> cat aescling's git repositories - mastodon.git/commitdiff
Mitigate inconsistent notifications
authorEugen <eugen@zeonfederated.com>
Sun, 22 Jan 2017 20:50:17 +0000 (21:50 +0100)
committerGitHub <noreply@github.com>
Sun, 22 Jan 2017 20:50:17 +0000 (21:50 +0100)
app/models/notification.rb

index c0b5c45a8c7df387d1310ce8a44a7d41be1a39bd..b7e8c9e71986750416afdb1c67633c1b644f9ccf 100644 (file)
@@ -39,9 +39,9 @@ class Notification < ApplicationRecord
   def target_status
     case type
     when :reblog
-      activity.reblog
+      activity&.reblog
     when :favourite, :mention
-      activity.status
+      activity&.status
     end
   end