fix(curated): fix crash when loading curated communities (#16971)

Fixes #16967

I cannot confirm for sure if the crash is fixed.
However, using the trace from the crash, I removed the function that caused the crash, since it's not useful, and since then, I couldn't reproduce the issue.
The problem is that the issue was not that easily reproducible.
This commit is contained in:
Jonathan Rainville 2024-12-16 11:28:07 -05:00 committed by GitHub
parent fa62885426
commit 19b862f268
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 7 deletions

View File

@ -226,9 +226,6 @@ proc isDisplayNameDupeOfCommunityMember*(self: Controller, displayName: string):
proc getCommunityById*(self: Controller, communityId: string): CommunityDto =
result = self.communityService.getCommunityById(communityId)
proc getCuratedCommunities*(self: Controller): seq[CommunityDto] =
result = self.communityService.getCuratedCommunities()
proc spectateCommunity*(self: Controller, communityId: string): string =
self.communityService.spectateCommunity(communityId)

View File

@ -873,9 +873,6 @@ QtObject:
proc getAllCommunities*(self: Service): seq[CommunityDto] =
return toSeq(self.communities.values)
proc getCuratedCommunities*(self: Service): seq[CommunityDto] =
return toSeq(self.getFilteredCuratedCommunities.values)
proc getCommunityById*(self: Service, communityId: string): CommunityDto =
if communityId == "":
return
@ -1855,7 +1852,7 @@ QtObject:
let curatedCommunities = parseCuratedCommunities(rpcResponseObj["response"]["result"])
for curatedCommunity in curatedCommunities:
self.communities[curatedCommunity.id] = curatedCommunity
self.events.emit(SIGNAL_CURATED_COMMUNITIES_LOADED, CommunitiesArgs(communities: self.getCuratedCommunities()))
self.events.emit(SIGNAL_CURATED_COMMUNITIES_LOADED, CommunitiesArgs(communities: curatedCommunities))
except Exception as e:
let errMsg = e.msg
error "error loading curated communities: ", errMsg