aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-12-10 21:06:45 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-12-21 20:28:55 +0530
commitb0afe8adaa4c8043798120f8638fe95153572857 (patch)
treeb5619f44d76846fd77bca9d7c02dc769929ee269 /app/src/main/java
parent964d05fdfe12e2095330b1e59e628690b5e3c29b (diff)
Try to fix missing `.gpg-id` files as well (#1246)
(cherry picked from commit c02ad427be3652298f4a07a5f1a0d68e4ac44c45) Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt5
1 files changed, 1 insertions, 4 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 01d85f2b..94a32ea4 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
@@ -335,10 +335,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
// pass enters the key ID into `.gpg-id`.
val repoRoot = PasswordRepository.getRepositoryDirectory()
val gpgIdentifierFile = File(repoRoot, directory.text.toString()).findTillRoot(".gpg-id", repoRoot)
- if (gpgIdentifierFile == null) {
- snackbar(message = resources.getString(R.string.failed_to_find_key_id))
- return@with
- }
+ ?: File(repoRoot, ".gpg-id").apply { createNewFile() }
val gpgIdentifiers = gpgIdentifierFile.readLines()
.filter { it.isNotBlank() }
.map { line ->