Fix Convertor Crash (with "existing entries in database that doesn't exist as enum new keys")

This commit is contained in:
Philoul 2021-02-22 14:56:29 +01:00
parent dec7232d42
commit 666e0a34aa

View file

@ -14,7 +14,7 @@ class Converters {
fun fromAction(action: UserEntry.Action?) = action?.name
@TypeConverter
fun toAction(action: String?) = action?.let { UserEntry.Action.valueOf(it) }
fun toAction(action: String?) = action?.let { UserEntry.Action.fromString(it) }
@TypeConverter
fun fromBolusType(bolusType: Bolus.Type?) = bolusType?.name