Guard sanitize() against undefined `short_names`

This is important when hovering over a custom emoji while searching.
nolan/hinaloe-test
Jakob Krigovsky 2017-05-26 12:04:26 +02:00
parent 153998ca2c
commit 346e398d6e
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ function unifiedToNative(unified) {
function sanitize(emoji) { function sanitize(emoji) {
var { name, short_names, skin_tone, skin_variations, emoticons, unified, custom, imageUrl } = emoji, var { name, short_names, skin_tone, skin_variations, emoticons, unified, custom, imageUrl } = emoji,
id = short_names[0], id = emoji.id || short_names[0],
colons = `:${id}:` colons = `:${id}:`
if (custom) { if (custom) {