From e17b6f51bedb6e6c6844958a1a41fc0198324a59 Mon Sep 17 00:00:00 2001 From: Shridhar Goel <35566748+ShridharGoel@users.noreply.github.com> Date: Mon, 22 Jul 2024 01:03:08 +0530 Subject: [PATCH 1/3] Fix crash on missing emoji mapping --- src/libs/EmojiUtils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/EmojiUtils.ts b/src/libs/EmojiUtils.ts index 007a892c048e..e2309a5a6bce 100644 --- a/src/libs/EmojiUtils.ts +++ b/src/libs/EmojiUtils.ts @@ -41,6 +41,9 @@ Onyx.connect({ emoji = {...emoji, ...findEmojiByCode(item.code)}; } const emojiWithSkinTones = Emojis.emojiCodeTableWithSkinTones[emoji.code]; + if (!emojiWithSkinTones) { + return null + } return {...emojiWithSkinTones, count: item.count, lastUpdatedAt: item.lastUpdatedAt}; }) .filter((emoji): emoji is FrequentlyUsedEmoji => !!emoji) ?? []; From c9aba773af02000b80bf464826c672cf70d31825 Mon Sep 17 00:00:00 2001 From: ShridharGoel <35566748+ShridharGoel@users.noreply.github.com> Date: Wed, 24 Jul 2024 01:50:42 +0530 Subject: [PATCH 2/3] Update --- src/libs/EmojiUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/EmojiUtils.ts b/src/libs/EmojiUtils.ts index e2309a5a6bce..22d54560e852 100644 --- a/src/libs/EmojiUtils.ts +++ b/src/libs/EmojiUtils.ts @@ -42,7 +42,7 @@ Onyx.connect({ } const emojiWithSkinTones = Emojis.emojiCodeTableWithSkinTones[emoji.code]; if (!emojiWithSkinTones) { - return null + return null; } return {...emojiWithSkinTones, count: item.count, lastUpdatedAt: item.lastUpdatedAt}; }) From a0a3f66b4d0775752b683ea6a99434396d563c54 Mon Sep 17 00:00:00 2001 From: ShridharGoel <35566748+ShridharGoel@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:55:59 +0530 Subject: [PATCH 3/3] Update --- src/libs/EmojiUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/EmojiUtils.ts b/src/libs/EmojiUtils.ts index 5d520fc67237..22b1ee0bc010 100644 --- a/src/libs/EmojiUtils.ts +++ b/src/libs/EmojiUtils.ts @@ -226,7 +226,7 @@ function getDynamicSpacing(emojiCount: number, suffix: number): EmojiSpacer[] { function addSpacesToEmojiCategories(emojis: PickerEmojis): EmojiPickerList { let updatedEmojis: EmojiPickerList = []; emojis.forEach((emoji, index) => { - if ('header' in emoji) { + if (emoji && 'header' in emoji) { updatedEmojis = updatedEmojis.concat(getDynamicSpacing(updatedEmojis.length, index), [emoji], getDynamicSpacing(1, index)); return; }