fix crash when de/serializing InstanceEntity

main
Conny Duck 7 years ago
parent 51b94b876f
commit 04d97acf44
  1. 4
      app/src/main/java/com/keylesspalace/tusky/db/InstanceEntity.kt

@ -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)
}
}
Loading…
Cancel
Save