Fixed issue #29

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

View file

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