From d2bb127e2c8c4a4df30024883ee36472fc86b688 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 12 Mar 2020 13:59:43 +0100 Subject: [PATCH] FIX: prevents crash when to be unescaped emoji is not a string (#9189) I couldn't get a repro so this is a shot in the dark and doesn't solve the root issue, but should prevent topic view from crashing. --- app/assets/javascripts/pretty-text/emoji.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/pretty-text/emoji.js.es6 b/app/assets/javascripts/pretty-text/emoji.js.es6 index 12077c01255..fa7754da596 100644 --- a/app/assets/javascripts/pretty-text/emoji.js.es6 +++ b/app/assets/javascripts/pretty-text/emoji.js.es6 @@ -92,7 +92,7 @@ function isReplacableInlineEmoji(string, index, inlineEmoji) { } export function performEmojiUnescape(string, opts) { - if (!string) { + if (!string || typeof string !== "string") { return; }