diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f34224a5..e9aa1ccae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Bugfix: Fixed the split "Search" menu action not opening the correct search window. (#4305) - Bugfix: Fixed an issue on Windows when opening links in incognito mode that contained forward slashes in hash (#4307) - Bugfix: Fixed an issue where beta versions wouldn't update to stable versions correctly. (#4329) +- Bugfix: Avoided crash that could occur when receiving channel point reward information. (#4360) - Dev: Changed sound backend from Qt to miniaudio. (#4334) - Dev: Remove protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256) - Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index ec8405c1a..a06e61b0b 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -304,7 +304,21 @@ void TwitchChannel::addChannelPointReward(const ChannelPointReward &reward) << "[TwitchChannel" << this->getName() << "] Channel point reward added:" << reward.id << "," << reward.title << "," << reward.isUserInputRequired; - this->channelPointRewardAdded.invoke(reward); + + // TODO: There's an underlying bug here. This bug should be fixed. + // This only attempts to prevent a crash when invoking the signal. + try + { + this->channelPointRewardAdded.invoke(reward); + } + catch (const std::bad_function_call &) + { + qCWarning(chatterinoTwitch).nospace() + << "[TwitchChannel " << this->getName() + << "] Caught std::bad_function_call when adding channel point " + "reward ChannelPointReward{ id: " + << reward.id << ", title: " << reward.title << " }."; + } } }