Fixed issue #29

This commit is contained in:
paulevsGitch 2020-12-06 21:14:18 +03:00
parent 8ae202ac44
commit e1e29be314

View file

@ -65,11 +65,14 @@ public class JsonFactory {
public static JsonObject getJsonObject(File jsonFile) { public static JsonObject getJsonObject(File jsonFile) {
if (jsonFile.exists()) { if (jsonFile.exists()) {
JsonObject jsonObject = loadJson(jsonFile).getAsJsonObject(); JsonElement json = loadJson(jsonFile);
if (jsonObject == null) { if (json != null && json.isJsonObject()) {
return new JsonObject(); JsonObject jsonObject = json.getAsJsonObject();
if (jsonObject == null) {
return new JsonObject();
}
return jsonObject;
} }
return jsonObject;
} }
return new JsonObject(); return new JsonObject();