Merge pull request #798 from greenart7c3/multiple-results-crash

fix crash parsing multiple results from amber
pull/799/head
Vitor Pamplona 2024-03-04 15:17:52 -05:00 zatwierdzone przez GitHub
commit 43e1e0f23e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 4 usunięć

Wyświetl plik

@ -33,8 +33,8 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import com.vitorpamplona.quartz.encoders.HexKey
import com.vitorpamplona.quartz.events.Event
import com.vitorpamplona.quartz.events.EventInterface
import com.vitorpamplona.quartz.events.LnZapRequestEvent
@ -90,9 +90,7 @@ class Result(
* Parses the json with a string of events to an Array of Event objects.
*/
fun fromJsonArray(json: String): Array<Result> {
return Event.mapper.readTree(json).map {
fromJson(it.asText())
}.toTypedArray()
return mapper.readValue(json)
}
}
}