From 09eda6a0cc4c029efd5bb29b9f88b94f013b648d Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Thu, 9 Dec 2021 14:40:17 -0600 Subject: [PATCH] Don't show reactions to missing reactables (#15249) Solves an issue where a moderator 'vomit' action on a subsequently deleted user causes the privileged reactions page to raise a NoMethodError accessing the reactable's details. I tried to accomplish this in the controller but it seems the `paginate` helper requires a relation rather than an array. --- app/views/admin/privileged_reactions/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/privileged_reactions/index.html.erb b/app/views/admin/privileged_reactions/index.html.erb index 5a78fd669..db395d9f1 100644 --- a/app/views/admin/privileged_reactions/index.html.erb +++ b/app/views/admin/privileged_reactions/index.html.erb @@ -30,7 +30,7 @@ - <% @privileged_reactions.each do |reaction| %> + <% @privileged_reactions.select(&:reactable).each do |reaction| %> <%= reaction.id %> <%= link_to reaction.user.username, admin_user_path(reaction.user_id) %>