Fix crash when ProfileHeaderView leaks
This commit is contained in:
parent
804fdb439d
commit
9b33059089
|
@ -181,8 +181,11 @@ class ProfileHeaderView: UIView {
|
|||
}
|
||||
|
||||
@objc private func updateUIForPreferences() {
|
||||
guard let mastodonController = mastodonController,
|
||||
let account = mastodonController.persistentContainer.account(for: accountID) else {
|
||||
// todo: mastodonController should never be nil, but ProfileHeaderViews are getting leaked
|
||||
guard let mastodonController = mastodonController else {
|
||||
return
|
||||
}
|
||||
guard let account = mastodonController.persistentContainer.account(for: accountID) else {
|
||||
fatalError("Missing cached account \(accountID!)")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue