Fixed issue #29
This commit is contained in:
parent
8ae202ac44
commit
e1e29be314
1 changed files with 7 additions and 4 deletions
|
@ -65,12 +65,15 @@ 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 (json != null && json.isJsonObject()) {
|
||||||
|
JsonObject jsonObject = json.getAsJsonObject();
|
||||||
if (jsonObject == null) {
|
if (jsonObject == null) {
|
||||||
return new JsonObject();
|
return new JsonObject();
|
||||||
}
|
}
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new JsonObject();
|
return new JsonObject();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue