Fix crash when previewing status cell that doesn't have delegate

Not sure how this is possible, but w/e
This commit is contained in:
Shadowfacts 2023-02-05 11:27:03 -05:00
parent 521c46c0be
commit 32382c4783
1 changed files with 4 additions and 1 deletions

View File

@ -762,7 +762,10 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
return UIContextMenuConfiguration { return UIContextMenuConfiguration {
ConversationViewController(for: self.statusID, state: self.statusState.copy(), mastodonController: self.mastodonController) ConversationViewController(for: self.statusID, state: self.statusState.copy(), mastodonController: self.mastodonController)
} actionProvider: { _ in } 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)))
} }
} }