summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-02-24 13:20:17 +0530
committerGitHub <noreply@github.com>2022-02-24 07:50:17 +0000
commitd8b5880215bad8868ab078736c5f6ea506a8b51c (patch)
treec58d0ddcb098eb659fe69337d0a5414a5c467bb1 /app/src/main/java
parentacc448ce740b3756c622daf35d7be8372e76cebb (diff)
Fix Autofill ANR when entry has no TOTP (#1746)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillPreferences.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillPreferences.kt b/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillPreferences.kt
index 2028fedb..051693d2 100644
--- a/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillPreferences.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillPreferences.kt
@@ -143,6 +143,7 @@ object AutofillPreferences {
// Always give priority to a username stored in the encrypted extras
val username =
entry.username ?: directoryStructure.getUsernameFor(file) ?: context.getDefaultUsername()
- return Credentials(username, entry.password, runBlocking { entry.totp.first() })
+ val totp = if (entry.hasTotp()) runBlocking { entry.totp.first() } else null
+ return Credentials(username, entry.password, totp)
}
}