Fix crash if profile header view outlives VC

This commit is contained in:
Shadowfacts 2020-08-15 17:59:14 -04:00
parent 090746f292
commit 29aed65b99
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 0 deletions

View File

@ -93,6 +93,7 @@ class ProfileHeaderView: UIView {
func updateUI(for accountID: String) { func updateUI(for accountID: String) {
self.accountID = accountID self.accountID = accountID
guard let mastodonController = mastodonController else { return }
guard let account = mastodonController.persistentContainer.account(for: accountID) else { guard let account = mastodonController.persistentContainer.account(for: accountID) else {
fatalError("Missing cached account \(accountID)") fatalError("Missing cached account \(accountID)")
} }