Skip to content

Commit

Permalink
fix crash on unloaded claimable lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jul 7, 2024
1 parent 0f5885b commit 937ca3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/managers/BetterInfoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ size_t BetterInfoCache::claimableListsCount() {
void BetterInfoCache::downloadClaimableLists() {
if(m_claimableLists.empty()) return;

size_t listNum = 0;

for(auto [listID, _] : m_claimableLists) {
if(_ != nullptr) continue;

Expand All @@ -318,7 +320,7 @@ void BetterInfoCache::showClaimableLists() {
searchObj->m_searchMode = 1;
auto lists = CCArray::create();
for(auto [_, list] : m_claimableLists) {
lists->addObject(list);
if(list) lists->addObject(list);
}
GameLevelManager::sharedState()->storeSearchResult(lists, fmt::format("{}:{}:{}", lists->count(), 0, lists->count()), searchObj->getKey());

Expand Down

0 comments on commit 937ca3e

Please sign in to comment.