From: ThibG Date: Fri, 17 Apr 2020 17:54:58 +0000 (+0200) Subject: Fix admin actions log crash when displaying updates of deleted announcements (#13489) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=89077fb65713ece348fdbee1986d1593383ba801;p=mastodon.git Fix admin actions log crash when displaying updates of deleted announcements (#13489) Fixes #13487 --- diff --git a/app/helpers/admin/action_logs_helper.rb b/app/helpers/admin/action_logs_helper.rb index 88d6e4580..8e398c3b2 100644 --- a/app/helpers/admin/action_logs_helper.rb +++ b/app/helpers/admin/action_logs_helper.rb @@ -47,7 +47,7 @@ module Admin::ActionLogsHelper I18n.t('admin.action_logs.deleted_status') end when 'Announcement' - truncate(attributes['text']) + truncate(attributes['text'].is_a?(Array) ? attributes['text'].last : attributes['text']) end end end