From a5350c68226bb7b8bc282a2d10463230d188d675 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 13 Feb 2020 13:32:22 -0500 Subject: [PATCH] Deal with potentially nullable player sample entries --- .../java/com/velocitypowered/api/proxy/server/ServerPing.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java index db3ef1ed5..7049c3c30 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java @@ -114,7 +114,7 @@ public final class ServerPing { if (players != null) { builder.onlinePlayers = players.online; builder.maximumPlayers = players.max; - builder.samplePlayers.addAll(players.sample); + builder.samplePlayers.addAll(players.getSample()); } else { builder.nullOutPlayers = true; } @@ -367,7 +367,7 @@ public final class ServerPing { } public List getSample() { - return sample; + return sample == null ? ImmutableList.of() : sample; } @Override