From ce4996075cb687ca0dcf124b49cccd961cc0721d Mon Sep 17 00:00:00 2001 From: Michal Iskierko Date: Fri, 15 Mar 2024 13:00:39 +0100 Subject: [PATCH] fix(@desktop/communities): Fix joining community Unexpected exception broke handleCommunityUpdates Fix #13958 --- src/app_service/service/community/service.nim | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index f435f126ad..9494f8749e 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -530,12 +530,14 @@ QtObject: let prevCommunity = self.communities[community.id] - let currOwner = community.findOwner() - let prevOwner = prevCommunity.findOwner() - - if currOwner.id != prevOwner.id: - for chat in community.chats: - self.updateMemberRole(chat.id, currOwner) + try: + let currOwner = community.findOwner() + let prevOwner = prevCommunity.findOwner() + if currOwner.id != prevOwner.id: + for chat in community.chats: + self.updateMemberRole(chat.id, currOwner) + except Exception: + discard # ownership lost if prevCommunity.isOwner and not community.isOwner: