make skin variation parsing more resilient

This commit is contained in:
Rasmus Karlsson 2018-06-06 12:40:26 +02:00
parent 714d3178d6
commit 712b1c4f12

View file

@ -127,8 +127,14 @@ void Emojis::loadEmojis()
auto variationEmojiData = std::make_shared<EmojiData>();
auto toneNameIt = toneNames.find(tone);
if (toneNameIt == toneNames.end()) {
debug::Log("Tone with key {} does not exist in tone names map", tone);
continue;
}
parseEmoji(variationEmojiData, variation,
emojiData->shortCode + "_" + toneNames[tone]);
emojiData->shortCode + "_" + toneNameIt->second);
this->emojiShortCodeToEmoji.insert(variationEmojiData->shortCode,
variationEmojiData);