]> cat aescling's git repositories - mastodon.git/commitdiff
Fix WebUI crash when processing accounts before page is loaded (#14015)
authorThibG <thib@sitedethib.com>
Tue, 9 Jun 2020 18:53:20 +0000 (20:53 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Jun 2020 18:53:20 +0000 (20:53 +0200)
app/javascript/mastodon/features/emoji/emoji.js

index 382ba683fcad5682355b42171d5a9f36191101b1..7bcda63eb78978316cf57009248cc3740e6c8057 100644 (file)
@@ -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;
 };