]> cat aescling's git repositories - mastodon.git/commitdiff
Fix 500 while searching after deleting a post (#6604)
authorAboobacker MK <aboobacker@redpanthers.co>
Sat, 3 Mar 2018 18:45:06 +0000 (00:15 +0530)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 3 Mar 2018 18:45:06 +0000 (19:45 +0100)
Fixes #6602

app/services/search_service.rb

index fe98566866d9493241eb6032f6e283e710e4ca30..00a8b3dd77d90fb55e72d6704f634b32469eb3be 100644 (file)
@@ -29,7 +29,9 @@ class SearchService < BaseService
   def perform_statuses_search!
     statuses = StatusesIndex.filter(term: { searchable_by: account.id })
                             .query(multi_match: { type: 'most_fields', query: query, operator: 'and', fields: %w(text text.stemmed) })
-                            .limit(limit).objects
+                            .limit(limit)
+                            .objects
+                            .compact
 
     statuses.reject { |status| StatusFilter.new(status, account).filtered? }
   end