From bbb2897d201d8eeab98d8ff4111ccfed5c640ae4 Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 9 Dec 2017 11:26:12 +0000 Subject: [PATCH] Fix compatibility with older Gson versions --- .../luckperms/common/contexts/ContextSetJsonSerializer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetJsonSerializer.java b/common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetJsonSerializer.java index b015ef20c..10bd08fc5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetJsonSerializer.java +++ b/common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetJsonSerializer.java @@ -74,7 +74,7 @@ public class ContextSetJsonSerializer { } JsonObject context = gson.fromJson(json, JsonObject.class); - if (context == null || context.size() == 0) { + if (context == null) { return ContextSet.empty(); } @@ -85,7 +85,7 @@ public class ContextSetJsonSerializer { Preconditions.checkArgument(element.isJsonObject()); JsonObject data = element.getAsJsonObject(); - if (data.size() == 0) { + if (data.entrySet().isEmpty()) { return ContextSet.empty(); }