Compare commits
1 commit
6986ab5a1c
...
a94867bb1b
Author | SHA1 | Date | |
---|---|---|---|
a94867bb1b |
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ data class ActivationCode(
|
||||||
companion object {
|
companion object {
|
||||||
fun fromString(input: String): ActivationCode {
|
fun fromString(input: String): ActivationCode {
|
||||||
check(input.startsWith("LPA:", ignoreCase = true)) { "Invalid activation code format" }
|
check(input.startsWith("LPA:", ignoreCase = true)) { "Invalid activation code format" }
|
||||||
val components = input.drop(4).split('$').map { it.trim().ifEmpty { null } }
|
val components = input.drop(4).split('$').map(String::trim).map { it.ifBlank { null } }
|
||||||
check(components.size >= 2) { "Invalid activation code format" }
|
check(components.size >= 2) { "Invalid activation code format" }
|
||||||
check(components[0] == "1") { "Invalid activation code version" }
|
check(components[0] == "1") { "Invalid activation code version" }
|
||||||
return ActivationCode(
|
return ActivationCode(
|
||||||
|
|
Loading…
Add table
Reference in a new issue