about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-12-07 18:26:30 -0600
committermultiple creatures <dev@multiple-creature.party>2019-12-07 18:26:30 -0600
commit776d558ff94b8b97fea3d92aa1dd2ee80f82d4c1 (patch)
treea0cbe3dfb9f69b1c9e17b0df6569156989ccf767 /app/lib
parent26622407719470d8773e177148297378f8f3b07e (diff)
skip posts that don't actually exist
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/status_filter.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/lib/status_filter.rb b/app/lib/status_filter.rb
index f4053947b..81faf129f 100644
--- a/app/lib/status_filter.rb
+++ b/app/lib/status_filter.rb
@@ -13,10 +13,11 @@ class StatusFilter
   end
 
   def filtered?
-    return true if redis.sismember("filtered_statuses:#{@account.id}", @status.id)
+    return true if status.nil? || account.nil?
     return false if !account.nil? && account.id == status.account_id
+    return true if redis.sismember("filtered_statuses:#{account.id}", status.id)
     if blocked_by_policy? || (account_present? && filtered_status?) || silenced_account?
-      redis.sadd("filtered_statuses:#{@account.id}", @status.id)
+      redis.sadd("filtered_statuses:#{account.id}", status.id)
       return true
     end
     false