File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
app/src/main/kotlin/com/revolgenx/anilib/entry/ui/component Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ fun DoubleCountEditor(
198198 if (it.length > 1 ) trimStart(' 0' )
199199 }
200200 }.ifBlank { " 0" }
201- val newScore = text.toDouble() .let (::getScoreWithInRange)
201+ val newScore = text.toDoubleOrNull()? .let (::getScoreWithInRange) ? : return @TextField
202202 if (newScore == count) {
203203 textFieldValueState = textFieldValue.copy(scoreValue)
204204 } else {
@@ -210,7 +210,7 @@ fun DoubleCountEditor(
210210 textFieldValueState = textFieldValue.copy(text)
211211 } else {
212212 val text = textFieldValue.text.trimStart(' 0' ).trim(' .' ).ifBlank { " 0" }
213- val newScore = text.toDouble() .let (::getScoreWithInRange)
213+ val newScore = text.toDoubleOrNull()? .let (::getScoreWithInRange) ? : return @TextField
214214 onScoreChange(newScore)
215215 }
216216 },
You can’t perform that action at this time.
0 commit comments