aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-06-21 02:21:44 +0530
committerFabian Henneke <FabianHenneke@users.noreply.github.com>2020-06-21 07:17:34 +0200
commita0b6f48b504bcb49e286d04aaab4631e2037d6c9 (patch)
tree5cabe9c70ccf2553cd04305d325c74cccf13baf9
parent2c6d4548c5a163ff17f4c0d1cebaf65c467c1ba4 (diff)
PasswordCreationActivity: properly guard rename code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt2
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)