mirror of
https://github.com/Ashinch/ReadYou.git
synced 2026-03-13 09:53:20 +08:00
fix: NumberFormatException
This commit is contained in:
@@ -191,12 +191,12 @@ internal class ImageCandidates(val baseUrl: String, val srcSet: String, val absS
|
||||
val descriptor = candidate.last()
|
||||
when {
|
||||
descriptor.endsWith("w", ignoreCase = true) -> {
|
||||
descriptor.substringBefore("w").toFloat() /
|
||||
(descriptor.substringBefore("w").toFloatOrNull() ?: return@fold acc) /
|
||||
maxSize.width.pxOrElse { 1 }
|
||||
}
|
||||
|
||||
descriptor.endsWith("x", ignoreCase = true) -> {
|
||||
descriptor.substringBefore("x").toFloat() / pixelDensity
|
||||
(descriptor.substringBefore("x").toFloatOrNull() ?: return@fold acc) / pixelDensity
|
||||
}
|
||||
|
||||
else -> {
|
||||
|
||||
Reference in New Issue
Block a user