From d7aa3f161730f32891faf09e4c5b6786bee046d1 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 12 Jan 2021 22:17:30 -0500 Subject: [PATCH] Fix crash when updating timestamp of removed status --- Tusker/Views/Status/TimelineStatusTableViewCell.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tusker/Views/Status/TimelineStatusTableViewCell.swift b/Tusker/Views/Status/TimelineStatusTableViewCell.swift index de2144533b..3580f1215e 100644 --- a/Tusker/Views/Status/TimelineStatusTableViewCell.swift +++ b/Tusker/Views/Status/TimelineStatusTableViewCell.swift @@ -123,8 +123,9 @@ class TimelineStatusTableViewCell: BaseStatusTableViewCell { 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 // so we bail out immediately, since there's nothing to update - guard let mastodonController = mastodonController else { return } - guard let status = mastodonController.persistentContainer.status(for: statusID) else { fatalError("Missing cached status \(statusID!)") } + // if the status cannot be found, it may have already been discarded due to not being on screen, so we do nothing + guard let mastodonController = mastodonController, + let status = mastodonController.persistentContainer.status(for: statusID) else { return } doUpdateTimestamp(status: status) }