migration bug fixed

This commit is contained in:
tom5079
2021-01-13 09:49:49 +09:00
parent 65ea09854e
commit 28b19b6774
4 changed files with 10 additions and 6 deletions

View File

@@ -137,5 +137,9 @@ operator fun JsonElement.get(index: Int) =
operator fun JsonElement.get(tag: String) =
this.jsonObject[tag]
fun JsonElement.getOrNull(tag: String) = kotlin.runCatching {
this.jsonObject.getOrDefault(tag, null)
}.getOrNull()
val JsonElement.content
get() = this.jsonPrimitive.contentOrNull