Fix crash when ProfileHeaderView leaks

This commit is contained in:
Shadowfacts 2022-01-21 11:09:55 -05:00
parent eca7f31e82
commit e65ed3e773
1 changed files with 2 additions and 1 deletions

View File

@ -181,7 +181,8 @@ class ProfileHeaderView: UIView {
}
@objc private func updateUIForPreferences() {
guard let account = mastodonController.persistentContainer.account(for: accountID) else {
guard let mastodonController = mastodonController,
let account = mastodonController.persistentContainer.account(for: accountID) else {
fatalError("Missing cached account \(accountID!)")
}