From cc6b8a96155a26f3ac0e51f41b1a00bd533fbb76 Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 9 Jun 2020 20:53:20 +0200 Subject: [PATCH] Fix WebUI crash when processing accounts before page is loaded (#14015) --- app/javascript/mastodon/features/emoji/emoji.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/emoji/emoji.js b/app/javascript/mastodon/features/emoji/emoji.js index 382ba683fc..7bcda63eb7 100644 --- a/app/javascript/mastodon/features/emoji/emoji.js +++ b/app/javascript/mastodon/features/emoji/emoji.js @@ -11,7 +11,7 @@ const darkEmoji = 'πŸŽ±πŸœβš«πŸ–€β¬›β—ΌοΈβ—Ύβ—ΌοΈβœ’οΈβ–ͺοΈπŸ’£πŸŽ³πŸ“·πŸ“Έ const lightEmoji = 'πŸ‘½βšΎπŸ”β˜οΈπŸ’¨πŸ•ŠοΈπŸ‘€πŸ₯πŸ‘»πŸβ•β”β›ΈοΈπŸŒ©οΈπŸ”ŠπŸ”‡πŸ“ƒπŸŒ§οΈπŸπŸšπŸ™πŸ“πŸ‘πŸ’€β˜ οΈπŸŒ¨οΈπŸ”‰πŸ”ˆπŸ’¬πŸ’­πŸπŸ³οΈβšͺβ¬œβ—½β—»οΈβ–«οΈ'; const emojiFilename = (filename, match) => { - const borderedEmoji = document.body.classList.contains('theme-mastodon-light') ? lightEmoji : darkEmoji; + const borderedEmoji = (document.body && document.body.classList.contains('theme-mastodon-light')) ? lightEmoji : darkEmoji; return borderedEmoji.includes(match) ? (filename + '_border') : filename; };