Fix Autofill ANR when entry has no TOTP (#1746)

This commit is contained in:
Harsh Shandilya 2022-02-24 13:20:17 +05:30 committed by GitHub
parent acc448ce74
commit d8b5880215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,6 +143,7 @@ object AutofillPreferences {
// Always give priority to a username stored in the encrypted extras // Always give priority to a username stored in the encrypted extras
val username = val username =
entry.username ?: directoryStructure.getUsernameFor(file) ?: context.getDefaultUsername() 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)
} }
} }