Skip to content

Commit

Permalink
safely execute the callback
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jan 15, 2024
1 parent 05d2e90 commit 3c1df5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/EmojiPicker/EmojiPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ const EmojiPicker = forwardRef((props, ref) => {
}
const currOnModalHide = onModalHide.current;
onModalHide.current = () => {
currOnModalHide();
if (currOnModalHide) {
currOnModalHide();
}
emojiPopoverAnchorRef.current = null;
};
setIsEmojiPickerVisible(false);
Expand Down

0 comments on commit 3c1df5e

Please sign in to comment.