Skip to content

Commit

Permalink
guidescreen: Handle when database access is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Jul 4, 2024
1 parent e18a6d0 commit 21d2f04
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/screens/guidescreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,15 @@ void WzGuideTopicsRegistry::setTopicSeen(const std::shared_ptr<WzWrappedGuideTop
if (topic->prefs.value().lastReadVersion != topic->topic->version)
{
topic->prefs.value().lastReadVersion = topic->topic->version;
activityDB->setGuideTopicPrefs(topic->topic->identifier, topic->prefs.value());

if (!activityDB)
{
activityDB = ActivityManager::instance().getRecord(); // might return nullptr if database access isn't available
}
if (activityDB)
{
activityDB->setGuideTopicPrefs(topic->topic->identifier, topic->prefs.value());
}
}
}

Expand Down

0 comments on commit 21d2f04

Please sign in to comment.