Accept empty contexts.json file as valid

This commit is contained in:
Luck committed 2020-02-11 15:35:16 +00:00
1 parent d937c9ce06
commit 9f7d431d34
1 file changed
+3
@@ -63,6 +63,9 @@ public class ContextsFile {
try (BufferedReader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
JsonObject data = GsonProvider.normal().fromJson(reader, JsonObject.class);
if (data == null) {
return;
}
if (data.has("static-contexts")) {
this.staticContexts = ContextSetJsonSerializer.deserializeContextSet(data.get("static-contexts").getAsJsonObject()).immutableCopy();