From 23097c8d1a78c6e18447c94fd28603a37c07f042 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 31 Oct 2023 15:28:06 +0100 Subject: [PATCH] Simplify confirmPassCode Signed-off-by: alperozturk --- .../android/ui/activity/PassCodeActivity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java index 5e3ed345b28f..279b8cd9a098 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java @@ -256,9 +256,7 @@ private void processFullPassCode() { savePassCodeAndExit(); } else { - showErrorAndRestart( - R.string.pass_code_mismatch, R.string.pass_code_configure_your_pass_code, View.VISIBLE - ); + showErrorAndRestart(R.string.pass_code_mismatch, R.string.pass_code_configure_your_pass_code, View.VISIBLE); } } } @@ -318,11 +316,13 @@ protected boolean checkPassCode() { protected boolean confirmPassCode() { confirmingPassCode = false; - boolean result = true; - for (int i = 0; i < passCodeEditTexts.length && result; i++) { - result = passCodeEditTexts[i].getText().toString().equals(passCodeDigits[i]); + for (int i = 0; i < passCodeEditTexts.length; i++) { + Editable passCodeText = passCodeEditTexts[i].getText(); + if (passCodeText == null || !passCodeText.toString().equals(passCodeDigits[i])) { + return false; + } } - return result; + return true; } /**