encoding shenanigans

This commit is contained in:
minjaesong
2023-05-09 21:40:17 +09:00
parent 831485bc35
commit 3c758ba82f
6 changed files with 42 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum.utils
import com.badlogic.gdx.utils.JsonReader
import com.badlogic.gdx.utils.JsonValue
import java.lang.NullPointerException
/**
* Created by minjaesong on 2016-02-15.
@@ -36,7 +37,13 @@ object JsonFetcher {
throw Error("[JsonFetcher] jsonString is null!")
}
return JsonReader().parse(jsonString.toString())
try {
return JsonReader().parse(jsonString.toString())
}
catch (e: NullPointerException) {
System.err.println("[JsonFetcher] NullPointerException while processing ${jsonFile.path}")
throw e
}
}
@Throws(java.io.IOException::class)