diff --git a/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt b/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt index 11763e598b..57b5b8a56b 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt +++ b/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt @@ -201,15 +201,20 @@ 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) } }