about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-04-03 22:54:46 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-04-03 22:54:46 +0200
commit8232f76c482d3046055bd7bf224ef7835d0fa399 (patch)
tree9f3c89d67e9878098fdcbfb2d0931d5f0f4d2261 /app/services
parent98a93aa07e087ea3af98253a55a9ba2a043c5b36 (diff)
Add check for visibility.nil? even though it can't ever be, to check for race conditions
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fan_out_on_write_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 402b84b2f..df404cbef 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -4,6 +4,8 @@ class FanOutOnWriteService < BaseService
   # Push a status into home and mentions feeds
   # @param [Status] status
   def call(status)
+    raise Mastodon::RaceConditionError if status.visibility.nil?
+
     deliver_to_self(status) if status.account.local?
 
     if status.direct_visibility?