Fix crash when receiving a whisper

Fix #672
This commit is contained in:
Rasmus Karlsson 2018-08-25 10:23:58 +00:00
parent d6c4244b79
commit 5647c6a80c

View file

@ -625,6 +625,12 @@ void TwitchMessageBuilder::appendTwitchEmote(
Outcome TwitchMessageBuilder::tryAppendEmote(const EmoteName &name) Outcome TwitchMessageBuilder::tryAppendEmote(const EmoteName &name)
{ {
// Special channels, like /whispers and /channels return here
// This means they will not render any BTTV or FFZ emotes
if (this->twitchChannel == nullptr) {
return Failure;
}
auto flags = MessageElementFlags(); auto flags = MessageElementFlags();
auto emote = boost::optional<EmotePtr>{}; auto emote = boost::optional<EmotePtr>{};