Skip to content

Commit

Permalink
Fix issue #4304 - The cause of the error is that the password validat…
Browse files Browse the repository at this point in the history
…ion logic runs for both password fields at the same time. When entering the first password, the second password field is empty, which causes the 'passwords do not match' error. This can be fixed by updating the code as follows:
  • Loading branch information
enescakar2148 committed Dec 27, 2024
1 parent 5cb924a commit 88612e2
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,19 @@ object EncryptAuthenticateDialog {
warningTextInputLayout,
btnOK,
) { text: String ->
if (text.isNotBlank() &&
text == comparingPasswordField.text.toString() &&
filenameIsValid(encryptSaveAsEditText.text.toString(), useAzeEncrypt)
) {
ReturnState()
} else if (text.isBlank()) {
ReturnState(STATE_ERROR, R.string.field_empty)
if (text.isNotBlank()) {
if (comparingPasswordField.text.toString().isBlank() ||
text == comparingPasswordField.text.toString()) {
if (filenameIsValid(encryptSaveAsEditText.text.toString(), useAzeEncrypt)) {
ReturnState()
} else {
ReturnState(STATE_ERROR, R.string.empty_string)
}
} else {
ReturnState(STATE_ERROR, R.string.password_no_match)
}
} else {
ReturnState(STATE_ERROR, R.string.password_no_match)
ReturnState(STATE_ERROR, R.string.field_empty)
}
}

Expand Down

0 comments on commit 88612e2

Please sign in to comment.