diff --git a/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java b/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java index c00500bf6..bcee83d31 100644 --- a/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java +++ b/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java @@ -101,12 +101,13 @@ public final class ContextSetJsonSerializer { Preconditions.checkArgument(element.isJsonObject()); JsonObject jsonObject = element.getAsJsonObject(); - if (jsonObject.size() == 0) { + Set> entries = jsonObject.entrySet(); + if (entries.isEmpty()) { return ImmutableContextSetImpl.EMPTY; } MutableContextSet contextSet = new MutableContextSetImpl(); - for (Map.Entry entry : jsonObject.entrySet()) { + for (Map.Entry entry : entries) { String k = entry.getKey(); JsonElement v = entry.getValue();