forked from shadowfacts/Tusker
Fix crash when updating timestamp of removed status
This commit is contained in:
parent
69c2faf0e1
commit
d7aa3f1617
|
@ -123,8 +123,9 @@ class TimelineStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
private func updateTimestamp() {
|
private func updateTimestamp() {
|
||||||
// if the mastodonController is nil (i.e. the delegate is nil), then the screen this cell was a part of has been deallocated
|
// if the mastodonController is nil (i.e. the delegate is nil), then the screen this cell was a part of has been deallocated
|
||||||
// so we bail out immediately, since there's nothing to update
|
// so we bail out immediately, since there's nothing to update
|
||||||
guard let mastodonController = mastodonController else { return }
|
// if the status cannot be found, it may have already been discarded due to not being on screen, so we do nothing
|
||||||
guard let status = mastodonController.persistentContainer.status(for: statusID) else { fatalError("Missing cached status \(statusID!)") }
|
guard let mastodonController = mastodonController,
|
||||||
|
let status = mastodonController.persistentContainer.status(for: statusID) else { return }
|
||||||
|
|
||||||
doUpdateTimestamp(status: status)
|
doUpdateTimestamp(status: status)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue