mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 14:55:19 +00:00
PasswordCreationActivity: properly guard rename code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
committed by
Fabian Henneke
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")
|
val oldFile = File("$repoPath/${oldCategory?.trim('/')}/$oldFileName.gpg")
|
||||||
if (oldFile.path != file.path && !oldFile.delete()) {
|
if (oldFile.path != file.path && !oldFile.delete()) {
|
||||||
setResult(RESULT_CANCELED)
|
setResult(RESULT_CANCELED)
|
||||||
|
Reference in New Issue
Block a user