From a6e5ac4562d120b4045fc721c767037cc31edcf4 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Wed, 6 Aug 2025 17:05:09 +0300 Subject: [PATCH] Fixed possible crash related to regint account setting --- app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt index 8a70ab87..9f4d1ff0 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt @@ -1498,7 +1498,11 @@ private fun checkOnClick(ctx: Context, ua: UserAgent): Boolean { reRegister = true } - val regInt = newRegInt.trim().toInt() + val regInt = try { + newRegInt.trim().toInt() + } catch (_: NumberFormatException) { + 0 + } if (regInt < 60 || regInt > 3600) { alertTitle.value = ctx.getString(R.string.notice) alertMessage.value = String.format(ctx.getString(R.string.invalid_reg_int), "$regInt")