mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-10-22 20:30:34 +02:00
Accept empty contexts.json file as valid
This commit is contained in:
parent
d937c9ce06
commit
9f7d431d34
@ -63,6 +63,9 @@ public class ContextsFile {
|
|||||||
|
|
||||||
try (BufferedReader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
|
try (BufferedReader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
|
||||||
JsonObject data = GsonProvider.normal().fromJson(reader, JsonObject.class);
|
JsonObject data = GsonProvider.normal().fromJson(reader, JsonObject.class);
|
||||||
|
if (data == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (data.has("static-contexts")) {
|
if (data.has("static-contexts")) {
|
||||||
this.staticContexts = ContextSetJsonSerializer.deserializeContextSet(data.get("static-contexts").getAsJsonObject()).immutableCopy();
|
this.staticContexts = ContextSetJsonSerializer.deserializeContextSet(data.get("static-contexts").getAsJsonObject()).immutableCopy();
|
||||||
|
Loading…
Reference in New Issue
Block a user