From 7ed24e72f6896ce290156b41661ab63219359177 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 9 Jan 2014 17:25:53 +0100 Subject: [PATCH] Correctly handle player samples set to null. --- .../com/comphenix/protocol/wrappers/WrappedServerPing.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java index 437b5b5c..7ed52bb2 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java @@ -246,7 +246,10 @@ public class WrappedServerPing extends AbstractWrapper { public ImmutableList getPlayers() { if (players == null) return ImmutableList.of(); - return ImmutableList.copyOf(PROFILE_CONVERT.getSpecific(PLAYERS_PROFILES.get(players))); + Object playerProfiles = PLAYERS_PROFILES.get(players); + if (playerProfiles == null) + return ImmutableList.of(); + return ImmutableList.copyOf(PROFILE_CONVERT.getSpecific(playerProfiles)); } /** @@ -256,7 +259,7 @@ public class WrappedServerPing extends AbstractWrapper { public void setPlayers(Iterable profile) { if (players == null) resetPlayers(); - PLAYERS_PROFILES.set(players, PROFILE_CONVERT.getGeneric(GameProfile[].class, profile)); + PLAYERS_PROFILES.set(players, (profile != null) ? PROFILE_CONVERT.getGeneric(GameProfile[].class, profile) : null); } /**