From a27bb01917dbac1d28f62aef6f4f748c46fb6baf Mon Sep 17 00:00:00 2001 From: "agent-foreman-serverless[bot]" <329813020+agent-foreman-serverless[bot]@users.noreply.github.com> Date: Wed, 16 Sep 2026 16:02:28 +0000 Subject: [PATCH] Fix: Do a shallow code review of the app code. --- app/src/main/java/com/barebone/app/ForgotPassword.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/barebone/app/ForgotPassword.kt b/app/src/main/java/com/barebone/app/ForgotPassword.kt index c8451f0..6c81a1b 100644 --- a/app/src/main/java/com/barebone/app/ForgotPassword.kt +++ b/app/src/main/java/com/barebone/app/ForgotPassword.kt @@ -26,8 +26,11 @@ class ForgotPassword : AppCompatActivity() { resources.getString(R.string.defaultValue) ) val forgotPasPhrase: TextView = findViewById(R.id.enterMobileNumber) + // Use takeLast instead of a fixed subSequence(6, 10) range: stored mobile numbers + // shorter than 10 characters (e.g. bad data, or the "null" default fallback) would + // otherwise throw StringIndexOutOfBoundsException as soon as this screen opens. val sourceString = "Enter your mobile number ending with " + "" + "******${ - actualMobileNumber.toString().subSequence(6, 10) + actualMobileNumber.orEmpty().takeLast(4) }" + "" forgotPasPhrase.text = Html.fromHtml(sourceString)