diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2020-12-10 21:06:45 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-12-21 20:28:55 +0530 |
commit | b0afe8adaa4c8043798120f8638fe95153572857 (patch) | |
tree | b5619f44d76846fd77bca9d7c02dc769929ee269 /app/src/main/java | |
parent | 964d05fdfe12e2095330b1e59e628690b5e3c29b (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.kt | 5 |
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 -> |