Fix crash if status table view cell outlives VC
This commit is contained in:
parent
70bedf17a8
commit
60565f9625
|
@ -102,7 +102,8 @@ class BaseStatusTableViewCell: UITableViewCell {
|
|||
.filter { [unowned self] in $0 == self.statusID }
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [unowned self] in
|
||||
if let status = self.mastodonController.persistentContainer.status(for: $0) {
|
||||
if let mastodonController = mastodonController,
|
||||
let status = mastodonController.persistentContainer.status(for: $0) {
|
||||
self.updateStatusState(status: status)
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +114,8 @@ class BaseStatusTableViewCell: UITableViewCell {
|
|||
.filter { [unowned self] in $0 == self.accountID }
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [unowned self] in
|
||||
if let account = self.mastodonController.persistentContainer.account(for: $0) {
|
||||
if let mastodonController = mastodonController,
|
||||
let account = mastodonController.persistentContainer.account(for: $0) {
|
||||
self.updateUI(account: account)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue