Fix assetJson util

Former-commit-id: 089c553c6f4a0dde6163869e75a928e4d7f7467b
This commit is contained in:
Ghost_chu committed 2020-01-26 16:44:16 +08:00
1 parent d8f606f397
commit 0368da392f
1 file changed
+2
@@ -38,6 +38,7 @@ public class AssetJson {
@Nullable
public String getLanguageHash(@NotNull String languageCode) {
languageCode = languageCode.replace("-","_").toLowerCase().trim();
JsonObject json = new JsonParser().parse(this.gameAssets).getAsJsonObject();
if (json == null || json.isJsonNull()) {
Util.debugLog("Cannot parse the json: " + this.gameAssets);
@@ -56,6 +57,7 @@ public class AssetJson {
JsonObject langObj = objs.getAsJsonObject(MsgUtil.fillArgs(pathTemplate, languageCode));
if (langObj == null || langObj.isJsonNull()) {
Util.debugLog("Cannot find request path.");
Util.debugLog(this.gameAssets);
return null;
}
JsonPrimitive hashObj = langObj.getAsJsonPrimitive("hash");