aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-12-10 21:06:45 +0530
committerGitHub <noreply@github.com>2020-12-10 21:06:45 +0530
commitc02ad427be3652298f4a07a5f1a0d68e4ac44c45 (patch)
treed5a0cb41547a0a6208b2b2b5931928e361f1e5e2 /app/src/main/java
parent29778e0e3da9f9c8b76c7ecaf92962779a7840ab (diff)
Try to fix missing `.gpg-id` files as well (#1246)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt
index 403f6e2a..2ddcc8b8 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/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 ->