Fix crash when viewing non-attachment message details.

// FREEBIE
pull/1/head
sdkjfhsdkjhfsdlkjhfsdf 8 years ago
parent 3b17c43e8b
commit 46930b9354

@ -400,8 +400,7 @@ class MessageDetailViewController: OWSViewController, UIScrollViewDelegate {
}
private func fetchAttachment(transaction: YapDatabaseReadTransaction) -> TSAttachment? {
guard let attachmentId = message.attachmentIds[0] as? String else {
owsFail("Invalid attachment")
guard let attachmentId = message.attachmentIds.firstObject as? String else {
return nil
}

Loading…
Cancel
Save