Skip to content

Commit

Permalink
Merge pull request #841 from Infomaniak/prevent-wrong-thread
Browse files Browse the repository at this point in the history
fix(AccountManager): Realm crash access wrong thread
  • Loading branch information
PhilippeWeidmann committed Jun 29, 2023
2 parents 35be097 + 07c76bc commit e045b1e
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 e045b1e

Please sign in to comment.