Fix crash when AccountTableViewCell is cached by a
SearchResultsTableViewController that has since decremented the reference count of the cell's account
This commit is contained in:
parent
830eea5e95
commit
e09b0ff4e3
|
@ -36,7 +36,8 @@ class AccountTableViewCell: UITableViewCell {
|
||||||
avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarImageView)
|
avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarImageView)
|
||||||
|
|
||||||
guard let account = mastodonController.persistentContainer.account(for: accountID) else {
|
guard let account = mastodonController.persistentContainer.account(for: accountID) else {
|
||||||
fatalError("Missing cached account \(accountID!)")
|
// this table view cell could be cached in a table view (e.g., SearchResultsViewController) for an account that's since been purged
|
||||||
|
return
|
||||||
}
|
}
|
||||||
displayNameLabel.updateForAccountDisplayName(account: account)
|
displayNameLabel.updateForAccountDisplayName(account: account)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue