about summary refs log tree commit diff
path: root/app/models/favourite.rb
diff options
context:
space:
mode:
authorpluralcafe-docker <docker@plural.cafe>2018-08-20 02:29:25 +0000
committerpluralcafe-docker <docker@plural.cafe>2018-08-20 02:29:25 +0000
commitc339d49d82b3fd2873831029d9c92b3fbf1236e3 (patch)
tree5a8528475f089f1e592dfbedd37ee91e6f748ffc /app/models/favourite.rb
parentb6e9537de469a178ce195b75fe8eaf03735e785a (diff)
parentf4d28ccfa3f9fd38a6d219fcde2d1a8bfcf6b306 (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/models/favourite.rb')
-rw-r--r--app/models/favourite.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/favourite.rb b/app/models/favourite.rb
index ce7a6a336..17f8c9fa6 100644
--- a/app/models/favourite.rb
+++ b/app/models/favourite.rb
@@ -32,11 +32,11 @@ class Favourite < ApplicationRecord
   private
 
   def increment_cache_counters
-    status.increment_count!(:favourites_count)
+    status&.increment_count!(:favourites_count)
   end
 
   def decrement_cache_counters
     return if association(:status).loaded? && (status.marked_for_destruction? || status.marked_for_mass_destruction?)
-    status.decrement_count!(:favourites_count)
+    status&.decrement_count!(:favourites_count)
   end
 end