Fix crash when trying to open context menu for attachment that hasn't yet loaded
This commit is contained in:
parent
150adeb581
commit
85812d774d
|
@ -445,8 +445,8 @@ extension StatusTableViewCell: MenuPreviewProvider {
|
|||
return (content: { ProfileTableViewController(accountID: self.accountID) }, actions: { self.actionsForProfile(accountID: self.accountID) })
|
||||
} else if attachmentsView.frame.contains(location) {
|
||||
let attachmentsViewLocation = attachmentsView.convert(location, from: self)
|
||||
if let attachmentView = attachmentsView.subviews.first(where: { $0.frame.contains(attachmentsViewLocation) }) as? AttachmentView {
|
||||
let image = attachmentView.image!
|
||||
if let attachmentView = attachmentsView.subviews.first(where: { $0.frame.contains(attachmentsViewLocation) }) as? AttachmentView,
|
||||
let image = attachmentView.image {
|
||||
let description = attachmentView.attachment.description
|
||||
return (content: { self.delegate?.largeImage(image, description: description, sourceView: attachmentView) }, actions: { [] })
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue