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.
This commit is contained in:
Daniel Uber 2021-12-09 14:40:17 -06:00 committed by GitHub
parent 02b1a5eb75
commit 09eda6a0cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@
</tr>
</thead>
<tbody class="crayons-card">
<% @privileged_reactions.each do |reaction| %>
<% @privileged_reactions.select(&:reactable).each do |reaction| %>
<tr>
<td class="whitespace-nowrap"><%= reaction.id %></td>
<td><%= link_to reaction.user.username, admin_user_path(reaction.user_id) %></td>