Skip to content

Commit

Permalink
Adding null check and run prettier
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Michel <pmiche04@gmail.com>
  • Loading branch information
ShogunFire committed Oct 17, 2023
1 parent b4bbd4c commit 34d0a51
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ function ComposerWithSuggestions({
if (!_.isEmpty(emojis)) {
const newEmojis = EmojiUtils.getAddedEmojis(emojis, emojisPresentBefore.current);
if (!_.isEmpty(newEmojis)) {
suggestionsRef.current.resetSuggestions();
if (suggestionsRef.current) {
suggestionsRef.current.resetSuggestions();
}
insertedEmojisRef.current = [...insertedEmojisRef.current, ...newEmojis];
debouncedUpdateFrequentlyUsedEmojis();
}
Expand All @@ -215,7 +217,6 @@ function ComposerWithSuggestions({
setIsCommentEmpty(!!newComment.match(/^(\s)*$/));
setValue(newComment);
if (commentValue !== newComment) {

const remainder = ComposerUtils.getCommonSuffixLength(commentValue, newComment);
setSelection({
start: newComment.length - remainder,
Expand Down

0 comments on commit 34d0a51

Please sign in to comment.