From 69d9e82ecbdf75d0dd834245fdbff37bc1cdadb9 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Sat, 4 Sep 2021 21:49:53 +0200 Subject: [PATCH] Apply the same fix to the whitelist command as well --- .../org/geysermc/floodgate/command/WhitelistCommand.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/geysermc/floodgate/command/WhitelistCommand.java b/common/src/main/java/org/geysermc/floodgate/command/WhitelistCommand.java index 02678380..22365d68 100644 --- a/common/src/main/java/org/geysermc/floodgate/command/WhitelistCommand.java +++ b/common/src/main/java/org/geysermc/floodgate/command/WhitelistCommand.java @@ -31,6 +31,7 @@ import cloud.commandframework.ArgumentDescription; import cloud.commandframework.Command; import cloud.commandframework.CommandManager; import cloud.commandframework.context.CommandContext; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.inject.Inject; import lombok.Getter; @@ -111,12 +112,14 @@ public class WhitelistCommand implements FloodgateCommand { } JsonObject data = response.getAsJsonObject("data"); - if (data.size() == 0) { + JsonElement xuidElement = data.get("xuid"); + + if (xuidElement == null) { sender.sendMessage(Message.USER_NOT_FOUND); return; } - String xuid = data.get("xuid").getAsString(); + String xuid = xuidElement.getAsString(); CommandUtil commandUtil = context.get("CommandUtil"); try {