]> cat aescling's git repositories - mastodon.git/commitdiff
Fix nil error in admin_account_link_to helper (#8578)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 2 Sep 2018 17:10:32 +0000 (19:10 +0200)
committerGitHub <noreply@github.com>
Sun, 2 Sep 2018 17:10:32 +0000 (19:10 +0200)
Fix #8573

app/helpers/admin/account_moderation_notes_helper.rb

index 49e764cefd6512eff86d0d5ee217e36c64c2f3ba..25586fbba38f12441b7c820fe7a6ab6b11f86d17 100644 (file)
@@ -2,6 +2,8 @@
 
 module Admin::AccountModerationNotesHelper
   def admin_account_link_to(account)
+    return if account.nil?
+
     link_to admin_account_path(account.id), class: name_tag_classes(account) do
       safe_join([
                   image_tag(account.avatar.url, width: 15, height: 15, alt: display_name(account), class: 'avatar'),
@@ -11,6 +13,8 @@ module Admin::AccountModerationNotesHelper
   end
 
   def admin_account_inline_link_to(account)
+    return if account.nil?
+
     link_to admin_account_path(account.id), class: name_tag_classes(account, true) do
       content_tag(:span, account.acct, class: 'username')
     end