From 32382c47837e50c48b0e2f523d74e074cab0b452 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 5 Feb 2023 11:27:03 -0500 Subject: [PATCH] Fix crash when previewing status cell that doesn't have delegate Not sure how this is possible, but w/e --- Tusker/Views/Status/TimelineStatusCollectionViewCell.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift index b02b475d..30b090c0 100644 --- a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift +++ b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift @@ -762,7 +762,10 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti return UIContextMenuConfiguration { ConversationViewController(for: self.statusID, state: self.statusState.copy(), mastodonController: self.mastodonController) } actionProvider: { _ in - UIMenu(children: self.delegate!.actionsForStatus(status, source: .view(self))) + guard let delegate = self.delegate else { + return nil + } + return UIMenu(children: delegate.actionsForStatus(status, source: .view(self))) } }