From 9b756043fb685fd77b7cac08215b8989b5396980 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 3 Mar 2022 11:36:05 -0600 Subject: [PATCH] ReactionsModal: defensive property checks --- app/soapbox/features/ui/components/reactions_modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/ui/components/reactions_modal.js b/app/soapbox/features/ui/components/reactions_modal.js index eabe50042..f0ede6c17 100644 --- a/app/soapbox/features/ui/components/reactions_modal.js +++ b/app/soapbox/features/ui/components/reactions_modal.js @@ -93,8 +93,8 @@ class ReactionsModal extends React.PureComponent { const { reaction } = this.state; const accounts = reactions && (reaction - ? reactions.find(reaction => reaction.name === this.state.reaction).accounts.map(account => ({ id: account, reaction: this.state.reaction })) - : reactions.map(reaction => reaction.accounts.map(account => ({ id: account, reaction: reaction.name }))).flatten()); + ? reactions.find(reaction => reaction.name === this.state.reaction)?.accounts.map(account => ({ id: account, reaction: this.state.reaction })) + : reactions.map(reaction => reaction?.accounts.map(account => ({ id: account, reaction: reaction.name }))).flatten()); let body;