From 153d1fce3ae43767819b97ebe472f8070ef9d76e Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Fri, 6 May 2022 14:44:28 +0200 Subject: [PATCH] throw on illegal oath type --- .../app/src/main/kotlin/com/yubico/authenticator/oath/Model.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/kotlin/com/yubico/authenticator/oath/Model.kt b/android/app/src/main/kotlin/com/yubico/authenticator/oath/Model.kt index bf43d5eb..49a01570 100644 --- a/android/app/src/main/kotlin/com/yubico/authenticator/oath/Model.kt +++ b/android/app/src/main/kotlin/com/yubico/authenticator/oath/Model.kt @@ -81,7 +81,8 @@ class Model { override fun deserialize(decoder: Decoder): OathType = when (decoder.decodeByte()) { OathType.HOTP.value -> OathType.HOTP - else -> OathType.TOTP + OathType.TOTP.value -> OathType.TOTP + else -> throw IllegalArgumentException() } override val descriptor: SerialDescriptor =