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")