Fix finding Otp digits (#511)
If no `digits` was present, this function failed with a `NullPointerException`.
This commit is contained in:
parent
064a3fad99
commit
055cacdd91
1 changed files with 2 additions and 2 deletions
|
@ -89,8 +89,8 @@ class PasswordEntry(private val content: String) {
|
||||||
|
|
||||||
private fun findOtpDigits(decryptedContent: String): String {
|
private fun findOtpDigits(decryptedContent: String): String {
|
||||||
decryptedContent.split("\n".toRegex()).forEach { line ->
|
decryptedContent.split("\n".toRegex()).forEach { line ->
|
||||||
if (line.startsWith("otpauth://totp/") ||
|
if ((line.startsWith("otpauth://totp/") ||
|
||||||
line.startsWith("otpauth://hotp/") &&
|
line.startsWith("otpauth://hotp/")) &&
|
||||||
Uri.parse(line).getQueryParameter("digits") != null) {
|
Uri.parse(line).getQueryParameter("digits") != null) {
|
||||||
return Uri.parse(line).getQueryParameter("digits")!!
|
return Uri.parse(line).getQueryParameter("digits")!!
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue