aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorBastian Köcher <bkchr@users.noreply.github.com>2019-05-16 09:49:18 +0200
committerHarsh Shandilya <msfjarvis@gmail.com>2019-05-16 13:19:18 +0530
commit055cacdd9143ef89a92a97170ac3c22a9aeda392 (patch)
tree177851570a9243c7036cd4045552b0578a170240 /app/src/main
parent064a3fad99d5852d50634a98023cb92c4a915606 (diff)
Fix finding Otp digits (#511)
If no `digits` was present, this function failed with a `NullPointerException`.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt
index 392bc749..0fad38d7 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt
@@ -89,8 +89,8 @@ class PasswordEntry(private val content: String) {
private fun findOtpDigits(decryptedContent: String): String {
decryptedContent.split("\n".toRegex()).forEach { line ->
- if (line.startsWith("otpauth://totp/") ||
- line.startsWith("otpauth://hotp/") &&
+ if ((line.startsWith("otpauth://totp/") ||
+ line.startsWith("otpauth://hotp/")) &&
Uri.parse(line).getQueryParameter("digits") != null) {
return Uri.parse(line).getQueryParameter("digits")!!
}