From 52efc8b752c63ca63ea330bb6847dfa2bb574e7d Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 27 May 2023 15:23:49 -0700 Subject: [PATCH] Fix crash if contextMenuConfiguration called on status cell that doesn't have a delegate Closes #392 --- Tusker/Views/Status/TimelineStatusCollectionViewCell.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift index 5c0a203e..3acf98f9 100644 --- a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift +++ b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift @@ -784,7 +784,8 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti } func contextMenuConfiguration() -> UIContextMenuConfiguration? { - guard let status = mastodonController.persistentContainer.status(for: statusID) else { + guard let mastodonController, + let status = mastodonController.persistentContainer.status(for: statusID) else { return nil } return UIContextMenuConfiguration {