fix crash when de/serializing InstanceEntity

This commit is contained in:
Conny Duck 2018-04-25 20:26:00 +02:00
parent 76eae44324
commit aecdbda375
1 changed files with 2 additions and 2 deletions

View File

@ -34,12 +34,12 @@ data class InstanceEntity(
class Converters {
@TypeConverter
fun jsonToList(emojiListJson: String): List<Emoji> {
fun jsonToList(emojiListJson: String?): List<Emoji>? {
return Gson().fromJson(emojiListJson, object : TypeToken<List<Emoji>>() {}.type)
}
@TypeConverter
fun listToJson(emojiList: List<Emoji>): String {
fun listToJson(emojiList: List<Emoji>?): String {
return Gson().toJson(emojiList)
}
}