Fix crash when ProfileHeaderView tries to create observers after ProfileVC is deinit'd
Can happen if the network is slow and the user closes the profile screen before the header loads
This commit is contained in:
parent
999118798c
commit
b56c6c37ec
|
@ -86,6 +86,11 @@ class ProfileHeaderView: UIView {
|
|||
}
|
||||
|
||||
private func createObservers() {
|
||||
// mastodonController may be nil if the ProfileViewController is deinit'd before the header is even created
|
||||
guard let mastodonController else {
|
||||
return
|
||||
}
|
||||
|
||||
cancellables = []
|
||||
|
||||
mastodonController.persistentContainer.accountSubject
|
||||
|
|
Loading…
Reference in New Issue