1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-09 13:50:52 +02:00

Accept empty contexts.json file as valid

This commit is contained in:
Luck
2020-02-11 15:35:16 +00:00
parent d937c9ce06
commit 9f7d431d34

View File

@@ -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();