diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2020-06-21 02:21:44 +0530 |
---|---|---|
committer | Fabian Henneke <FabianHenneke@users.noreply.github.com> | 2020-06-21 07:17:34 +0200 |
commit | a0b6f48b504bcb49e286d04aaab4631e2037d6c9 (patch) | |
tree | 5cabe9c70ccf2553cd04305d325c74cccf13baf9 /app | |
parent | 2c6d4548c5a163ff17f4c0d1cebaf65c467c1ba4 (diff) |
PasswordCreationActivity: properly guard rename code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt index c34d1a8a..67bf9926 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt @@ -286,7 +286,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB } } - if (category.isVisible && category.isEnabled) { + if (category.isVisible && category.isEnabled && oldFileName != null) { val oldFile = File("$repoPath/${oldCategory?.trim('/')}/$oldFileName.gpg") if (oldFile.path != file.path && !oldFile.delete()) { setResult(RESULT_CANCELED) |