From e8a5dc2627abbf8401e9dab649f519bff9132b32 Mon Sep 17 00:00:00 2001 From: piotrek Date: Mon, 12 Dec 2022 00:01:10 +0100 Subject: [PATCH] ApsMode enum - refactor of fromString --- .../src/main/java/info/nightscout/interfaces/ApsMode.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt index c6f8106b6f..c6d4b1fbd8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt +++ b/core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt @@ -8,6 +8,6 @@ enum class ApsMode() { companion object { - fun fromString(stringValue: String?) = values().firstOrNull { it.name == (stringValue?.uppercase() ?: UNDEFINED) } + fun fromString(stringValue: String?) = values().firstOrNull { it.name == (stringValue?.uppercase() ?: UNDEFINED.name) } ?: UNDEFINED } }