Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check application in 7TV event-api #5768

Merged
merged 3 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unversioned

- Bugfix: Fixed a crash in the 7TV EventApi when closing Chatterino. (#5768)
- Bugfix: Fixed scrollbar highlights being visible in overlay windows. (#5769)
- Bugfix: Make macos fonts look the same as v2.5.1. (#5775)
- Bugfix: Fixed 7TV usernames messing with Qt's HTML (#5780)
Expand Down
24 changes: 21 additions & 3 deletions src/providers/seventv/SeventvEventAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,13 @@ void SeventvEventAPI::onUserUpdate(const Dispatch &dispatch)

void SeventvEventAPI::onCosmeticCreate(const CosmeticCreateDispatch &cosmetic)
{
auto *badges = getApp()->getSeventvBadges();
auto *app = tryGetApp();
if (!app)
{
return; // shutting down
}

auto *badges = app->getSeventvBadges();
switch (cosmetic.kind)
{
case CosmeticKind::Badge: {
Expand All @@ -378,7 +384,13 @@ void SeventvEventAPI::onCosmeticCreate(const CosmeticCreateDispatch &cosmetic)
void SeventvEventAPI::onEntitlementCreate(
const EntitlementCreateDeleteDispatch &entitlement)
{
auto *badges = getApp()->getSeventvBadges();
auto *app = tryGetApp();
if (!app)
{
return; // shutting down
}

auto *badges = app->getSeventvBadges();
switch (entitlement.kind)
{
case CosmeticKind::Badge: {
Expand All @@ -394,7 +406,13 @@ void SeventvEventAPI::onEntitlementCreate(
void SeventvEventAPI::onEntitlementDelete(
const EntitlementCreateDeleteDispatch &entitlement)
{
auto *badges = getApp()->getSeventvBadges();
auto *app = tryGetApp();
if (!app)
{
return; // shutting down
}

auto *badges = app->getSeventvBadges();
switch (entitlement.kind)
{
case CosmeticKind::Badge: {
Expand Down
Loading