From a0b6f48b504bcb49e286d04aaab4631e2037d6c9 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 21 Jun 2020 02:21:44 +0530 Subject: PasswordCreationActivity: properly guard rename code Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') 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) -- cgit v1.2.3