diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-06-02 03:52:27 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-06-02 15:44:14 -0500 |
commit | c88d9cf34c97a27db55f9b90b29ede5d20a1f156 (patch) | |
tree | 923fa96f27cb788d8c228694b1eb8a12ea50de4d /app/assets/javascripts/behaviors | |
parent | 256a8601fb3e762193973afff25152dcdab9930c (diff) | |
download | gitlab-ce-c88d9cf34c97a27db55f9b90b29ede5d20a1f156.tar.gz |
Fix NPE with horse racing emoji check32587-fix-horse-racing-emoji-codepointat-npe
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/32587
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/gl_emoji.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/assets/javascripts/behaviors/gl_emoji.js b/app/assets/javascripts/behaviors/gl_emoji.js index 23d91fdb259..36ce4fddb72 100644 --- a/app/assets/javascripts/behaviors/gl_emoji.js +++ b/app/assets/javascripts/behaviors/gl_emoji.js @@ -88,6 +88,7 @@ function installGlEmojiElement() { const hasCssSpriteFalback = fallbackSpriteClass && fallbackSpriteClass.length > 0; if ( + emojiUnicode && isEmojiUnicode && !isEmojiUnicodeSupported(generatedUnicodeSupportMap, emojiUnicode, unicodeVersion) ) { diff --git a/app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js b/app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js index 20ab2d7e827..4f8884d05ac 100644 --- a/app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js +++ b/app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js @@ -28,7 +28,8 @@ function isSkinToneComboEmoji(emojiUnicode) { // doesn't support the skin tone versions of horse racing const horseRacingCodePoint = 127943;// parseInt('1F3C7', 16) function isHorceRacingSkinToneComboEmoji(emojiUnicode) { - return Array.from(emojiUnicode)[0].codePointAt(0) === horseRacingCodePoint && + const firstCharacter = Array.from(emojiUnicode)[0]; + return firstCharacter && firstCharacter.codePointAt(0) === horseRacingCodePoint && isSkinToneComboEmoji(emojiUnicode); } |