Skip to content

A platform for community discussion. Free, open, simple.

FIX: prevents crash when to be unescaped emoji is not a string (#9189)

Joffrey JAFFEUXd2bb127e2c8c
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;
}