throw on illegal oath type

This commit is contained in:
Adam Velebil 2022-05-06 14:44:28 +02:00
parent 0a65ad6a73
commit 153d1fce3a
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084

View File

@ -81,7 +81,8 @@ class Model {
override fun deserialize(decoder: Decoder): OathType = override fun deserialize(decoder: Decoder): OathType =
when (decoder.decodeByte()) { when (decoder.decodeByte()) {
OathType.HOTP.value -> OathType.HOTP OathType.HOTP.value -> OathType.HOTP
else -> OathType.TOTP OathType.TOTP.value -> OathType.TOTP
else -> throw IllegalArgumentException()
} }
override val descriptor: SerialDescriptor = override val descriptor: SerialDescriptor =