From 36155d94aba1d4d84b24eeb4d0e4c76b4435ad9f Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Tue, 1 Oct 2024 21:20:00 +0600 Subject: [PATCH] chore: handle NumberFormatException --- .../at/bitfire/davdroid/ui/setup/SendInviteFragment.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/at/bitfire/davdroid/ui/setup/SendInviteFragment.kt b/app/src/main/kotlin/at/bitfire/davdroid/ui/setup/SendInviteFragment.kt index 89b7b340b..2a8ee2ac2 100644 --- a/app/src/main/kotlin/at/bitfire/davdroid/ui/setup/SendInviteFragment.kt +++ b/app/src/main/kotlin/at/bitfire/davdroid/ui/setup/SendInviteFragment.kt @@ -131,7 +131,12 @@ class SendInviteFragment : Fragment() { trimedResult.lastIndexOf(":") + 1, trimedResult.length - 1 ) - return errorCode.toInt() + + return try { + errorCode.toInt() + } catch (e: NumberFormatException) { + -1 + } } private fun handleErrorCode(intCode: Int) { -- GitLab