From 8eb2bd8e35fd9d02330cbf009e1273f4bb893eb0 Mon Sep 17 00:00:00 2001 From: asie Date: Sun, 10 Feb 2019 16:05:24 +0100 Subject: [PATCH] fix PlayerStream.all crashing during early server init --- .../java/net/fabricmc/fabric/api/server/PlayerStream.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java b/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java index 66e34cb0c..1007e76ea 100644 --- a/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java +++ b/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java @@ -42,7 +42,11 @@ public final class PlayerStream { } public static Stream all(MinecraftServer server) { - return server.getPlayerManager().getPlayerList().stream(); + if (server.getPlayerManager() != null) { + return server.getPlayerManager().getPlayerList().stream(); + } else { + return Stream.empty(); + } } public static Stream world(World world) {