From d2eb726962187226c85ef7f2ee1886cb0767bbd1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 27 Oct 2022 02:10:54 +0200 Subject: Fix notifications about deleted reports not being also deleted (#19475) * Fix notifications about deleted reports not being also deleted * Fix notification with empty report crashing web UI Fix #18909 --- .../mastodon/features/notifications/components/notification.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/mastodon/features/notifications/components/notification.js index 0af71418c..5974e378e 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.js +++ b/app/javascript/mastodon/features/notifications/components/notification.js @@ -372,6 +372,10 @@ class Notification extends ImmutablePureComponent { renderAdminReport (notification, account, link) { const { intl, unread, report } = this.props; + if (!report) { + return null; + } + const targetAccount = report.get('target_account'); const targetDisplayNameHtml = { __html: targetAccount.get('display_name_html') }; const targetLink = ; -- cgit