mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-09 04:09:43 +01:00
Correctly handle player samples set to null.
This commit is contained in:
parent
2a729cfe2d
commit
7ed24e72f6
@ -246,7 +246,10 @@ public class WrappedServerPing extends AbstractWrapper {
|
|||||||
public ImmutableList<WrappedGameProfile> getPlayers() {
|
public ImmutableList<WrappedGameProfile> getPlayers() {
|
||||||
if (players == null)
|
if (players == null)
|
||||||
return ImmutableList.of();
|
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<? extends WrappedGameProfile> profile) {
|
public void setPlayers(Iterable<? extends WrappedGameProfile> profile) {
|
||||||
if (players == null)
|
if (players == null)
|
||||||
resetPlayers();
|
resetPlayers();
|
||||||
PLAYERS_PROFILES.set(players, PROFILE_CONVERT.getGeneric(GameProfile[].class, profile));
|
PLAYERS_PROFILES.set(players, (profile != null) ? PROFILE_CONVERT.getGeneric(GameProfile[].class, profile) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user