Skip to content

Commit

Permalink
fix(AccountManager): Realm crash access wrong thread
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Jun 29, 2023
1 parent 5397899 commit 07c76bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MailCore/Cache/AccountManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public class AccountManager: RefreshTokenDelegate {
}

MailboxInfosManager.instance.storeMailboxes(user: user, mailboxes: mailboxesResponse)
if let mainMailbox = mailboxesResponse.first(where: { $0.isPrimary }) ?? mailboxesResponse.first {
if let mainMailbox = (mailboxesResponse.first(where: { $0.isPrimary }) ?? mailboxesResponse.first)?.freezeIfNeeded() {
await notificationService.updateTopicsIfNeeded([mainMailbox.notificationTopicName], userApiFetcher: apiFetcher)
setCurrentMailboxForCurrentAccount(mailbox: mainMailbox)
}
Expand Down

0 comments on commit 07c76bc

Please sign in to comment.