Fix crash due to leaked ProfileHeaderView not having a

mastodonController
This commit is contained in:
Shadowfacts 2021-11-22 21:38:00 -05:00
parent 2b50609e5c
commit ca5ac8b826
1 changed files with 5 additions and 3 deletions

View File

@ -171,9 +171,11 @@ class ProfileHeaderView: UIView {
}
private func updateRelationship() {
guard let relationship = mastodonController.persistentContainer.relationship(forAccount: accountID) else {
return
}
// todo: mastodonController should never be nil, but ProfileHeaderViews are getting leaked
guard let mastodonController = mastodonController,
let relationship = mastodonController.persistentContainer.relationship(forAccount: accountID) else {
return
}
followsYouLabel.isHidden = !relationship.followedBy
}