diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-02-24 13:20:17 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-24 07:50:17 +0000 |
commit | d8b5880215bad8868ab078736c5f6ea506a8b51c (patch) | |
tree | c58d0ddcb098eb659fe69337d0a5414a5c467bb1 /app | |
parent | acc448ce740b3756c622daf35d7be8372e76cebb (diff) |
Fix Autofill ANR when entry has no TOTP (#1746)
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillPreferences.kt | 3 |
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) } } |