mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-23 19:16:37 +01:00
Avoid calling JsonObject#size for compat with older gson versions (#2598)
This commit is contained in:
parent
5e48224c78
commit
2adaea2dac
@ -101,12 +101,13 @@ public final class ContextSetJsonSerializer {
|
||||
Preconditions.checkArgument(element.isJsonObject());
|
||||
JsonObject jsonObject = element.getAsJsonObject();
|
||||
|
||||
if (jsonObject.size() == 0) {
|
||||
Set<Map.Entry<String, JsonElement>> entries = jsonObject.entrySet();
|
||||
if (entries.isEmpty()) {
|
||||
return ImmutableContextSetImpl.EMPTY;
|
||||
}
|
||||
|
||||
MutableContextSet contextSet = new MutableContextSetImpl();
|
||||
for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {
|
||||
for (Map.Entry<String, JsonElement> entry : entries) {
|
||||
String k = entry.getKey();
|
||||
JsonElement v = entry.getValue();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user