mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
Fix NPE race condition in ServerListPingEvent
Fixes GH-1473 If a ping is responded to prior to the server sample being populated (pre-tick as an example) it can result in an NPE.
This commit is contained in:
parent
004b92b0e8
commit
003c0e0766
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ index 0000000000..350410527b
|
|||
+
|
||||
+ private StandardPaperServerListPingEventImpl(MinecraftServer server, NetworkManager networkManager, ServerPing ping) {
|
||||
+ super(server, new PaperStatusClient(networkManager), ping.getServerData().getProtocolVersion(), server.server.getServerIcon());
|
||||
+ this.originalSample = ping.getPlayers().getSample();
|
||||
+ this.originalSample = ping.getPlayers() == null ? null : ping.getPlayers().getSample(); // GH-1473 - pre-tick race condition NPE
|
||||
+ }
|
||||
+
|
||||
+ @Nonnull
|
||||
|
|
Loading…
Reference in a new issue