fix: NaN aspect ratio can cause crash
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
6447bf6ffe
commit
1b476ed7de
|
|
@ -125,7 +125,9 @@ fun RegularEmbed(
|
|||
}
|
||||
)
|
||||
.aspectRatio(
|
||||
(it.width?.toFloat() ?: 0f) / (it.height?.toFloat() ?: 0f)
|
||||
((it.width?.toFloat() ?: 0f) / (it.height?.toFloat() ?: 0f)).let {
|
||||
if (it.isNaN()) 1f else it
|
||||
}
|
||||
),
|
||||
contentScale = ContentScale.Crop,
|
||||
description = null // decorative
|
||||
|
|
|
|||
Loading…
Reference in New Issue