1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Apply the same fix to the whitelist command as well

This commit is contained in:
Tim203
2021-09-04 21:49:53 +02:00
parent 8df1b1e03e
commit 69d9e82ecb

View File

@@ -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 {