File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
API/src/main/java/com/comphenix/protocol/utility
ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public static Object getNetworkManager(Player player) {
47
47
* @return The player connection.
48
48
*/
49
49
public static Object getPlayerConnection (Player player ) {
50
+ Preconditions .checkNotNull (player , "player cannot be null!" );
50
51
return getPlayerConnection (BukkitUnwrapper .getInstance ().unwrapItem (player ));
51
52
}
52
53
Original file line number Diff line number Diff line change @@ -671,7 +671,7 @@ private void invokeSendPacket(Object packet) {
671
671
MinecraftMethods .getSendPacketMethod ().invoke (getPlayerConnection (), packet );
672
672
}
673
673
} catch (Throwable ex ) {
674
- ProtocolLibrary .getErrorReporter ().reportWarning (factory . getPlugin () ,
674
+ ProtocolLibrary .getErrorReporter ().reportWarning (this ,
675
675
Report .newBuilder (REPORT_CANNOT_SEND_PACKET ).messageParam (packet , playerName ).error (ex ).build ());
676
676
}
677
677
}
@@ -716,7 +716,7 @@ public Protocol getCurrentProtocol() {
716
716
*/
717
717
private Object getPlayerConnection () {
718
718
if (playerConnection == null ) {
719
- playerConnection = MinecraftFields .getPlayerConnection (player );
719
+ playerConnection = MinecraftFields .getPlayerConnection (getPlayer () );
720
720
}
721
721
return playerConnection ;
722
722
}
You can’t perform that action at this time.
0 commit comments