Solves crashing when events have null tags.

This commit is contained in:
Vitor Pamplona
2023-03-08 08:31:56 -05:00
parent 77a70c3202
commit 7275799f9d

View File

@@ -89,7 +89,7 @@ open class Event(
createdAt = jsonObject.get("created_at").asLong,
kind = jsonObject.get("kind").asInt,
tags = jsonObject.get("tags").asJsonArray.map {
it.asJsonArray.map { s -> s.asString }
it.asJsonArray.mapNotNull { s -> if (s.isJsonNull) null else s.asString }
},
content = jsonObject.get("content").asString,
sig = jsonObject.get("sig").asString