mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2025-09-06 17:04:09 +02:00
PasswordCreationActivity: properly guard rename code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
2c6d4548c5
commit
a0b6f48b50
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue