#3355,#3357: Fix possible NPE's in LoginEvent & PreLoginEvent
This commit is contained in:
parent
587fb37bdf
commit
12e4514813
@ -428,7 +428,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
{
|
{
|
||||||
if ( result.isCancelled() )
|
if ( result.isCancelled() )
|
||||||
{
|
{
|
||||||
disconnect( result.getCancelReasonComponents() );
|
BaseComponent[] reason = result.getCancelReasonComponents();
|
||||||
|
disconnect( ( reason != null ) ? reason : TextComponent.fromLegacyText( bungee.getTranslation( "kick_message" ) ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( ch.isClosed() )
|
if ( ch.isClosed() )
|
||||||
@ -551,7 +552,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
{
|
{
|
||||||
if ( result.isCancelled() )
|
if ( result.isCancelled() )
|
||||||
{
|
{
|
||||||
disconnect( result.getCancelReasonComponents() );
|
BaseComponent[] reason = result.getCancelReasonComponents();
|
||||||
|
disconnect( ( reason != null ) ? reason : TextComponent.fromLegacyText( bungee.getTranslation( "kick_message" ) ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( ch.isClosed() )
|
if ( ch.isClosed() )
|
||||||
|
Loading…
Reference in New Issue
Block a user