Skip to content

Commit f74021f

Browse files
jnavarromrgmez
authored andcommitted
MEET-4480: Crash at ChatMediaCollectionViewCell
1 parent ada7ec4 commit f74021f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

iMEGA/Chat Messages/Views/ChatMediaCollectionViewCell.swift

+7-5
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@ class ChatMediaCollectionViewCell: MessageContentCell, MEGATransferDelegate {
163163

164164
if FileManager.default.fileExists(atPath: previewFilePath) || FileManager.default.fileExists(atPath: originalImagePath) {
165165
loadingIndicator.stopAnimating()
166-
if let previewImage = UIImage(contentsOfFile: previewFilePath) ?? UIImage(contentsOfFile: originalImagePath),
167-
(previewImage.size.width / previewImage.size.height).precised(2) != (messageContainerView.frame.width / messageContainerView.frame.height).precised(2),
168-
messagesCollectionView.numberOfSections > indexPath.section {
169-
imageView.image = nil
170-
messagesCollectionView.reloadItems(at: [indexPath])
166+
if #unavailable(iOS 18.0) {
167+
if let previewImage = UIImage(contentsOfFile: previewFilePath) ?? UIImage(contentsOfFile: originalImagePath),
168+
(previewImage.size.width / previewImage.size.height).precised(2) != (messageContainerView.frame.width / messageContainerView.frame.height).precised(2),
169+
messagesCollectionView.numberOfSections > indexPath.section {
170+
imageView.image = nil
171+
messagesCollectionView.reloadItems(at: [indexPath])
172+
}
171173
}
172174
} else {
173175
downloadGifIcon.isHidden = true

0 commit comments

Comments
 (0)