Skip to content

Commit

Permalink
Add optional chaining for sender
Browse files Browse the repository at this point in the history
  • Loading branch information
HoonBaek committed Dec 10, 2021
1 parent d3e3286 commit 0e8c98b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function MessageHoc({
return null;
}, [message, message.message, renderCustomMessage]);

const isByMe = (userId === sender.userId)
const isByMe = (userId === sender?.userId)
|| (message.requestState === 'pending')
|| (message.requestState === 'failed');

Expand Down

0 comments on commit 0e8c98b

Please sign in to comment.