Fix potential crash with invalid attachment aspect ratio

This commit is contained in:
Shadowfacts 2024-11-26 23:17:52 -05:00
parent 583d9b97dd
commit e8a492ef7d
1 changed files with 5 additions and 1 deletions

View File

@ -295,7 +295,11 @@ class AttachmentsContainerView: UIView {
accessibilityElements.append(moreView)
}
self.aspectRatio = aspectRatio
self.aspectRatio = if aspectRatio.isNaN || aspectRatio.isInfinite {
16/9
} else {
aspectRatio
}
} else {
self.isHidden = true
}