Fix UIImage when content.filePath is nil

This commit is contained in:
Benoit Martins 2023-12-12 13:13:54 +01:00
parent 2db146787e
commit 70ff69aa63

View file

@ -1215,10 +1215,14 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
ChatConversationViewModel.sharedModel.removeTmpFile(filePath: plainFile)
plainFile = ""
}else{
}else if content.filePath != nil {
if let imageMessage = UIImage(named: content.filePath!){
self.imageViewBubble.image = self.resizeImage(image: imageMessage, targetSize: CGSize(width: UIScreen.main.bounds.size.width*3/4, height: 300.0))
}
} else {
if let imageMessage = UIImage(named: "file_default"){
self.imageViewBubble.image = self.resizeImage(image: imageMessage, targetSize: CGSize(width: UIScreen.main.bounds.size.width*3/4, height: 300.0))
}
}
if(content.isFile){