mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 01:57:55 +01:00
Null check plugin input for servers
This commit is contained in:
parent
a9d3d9461f
commit
b041d84063
@ -2,6 +2,7 @@ package net.md_5.bungee.api.event;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NonNull;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
import net.md_5.bungee.api.config.ServerInfo;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -21,6 +22,7 @@ public class ServerConnectEvent extends Event implements Cancellable
|
|||||||
/**
|
/**
|
||||||
* Server the player will be connected to.
|
* Server the player will be connected to.
|
||||||
*/
|
*/
|
||||||
|
@NonNull
|
||||||
private ServerInfo target;
|
private ServerInfo target;
|
||||||
/**
|
/**
|
||||||
* Cancelled state.
|
* Cancelled state.
|
||||||
|
@ -171,6 +171,8 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
|
|
||||||
public void connect(ServerInfo info, final boolean retry)
|
public void connect(ServerInfo info, final boolean retry)
|
||||||
{
|
{
|
||||||
|
Preconditions.checkNotNull( info, "info" );
|
||||||
|
|
||||||
ServerConnectEvent event = new ServerConnectEvent( this, info );
|
ServerConnectEvent event = new ServerConnectEvent( this, info );
|
||||||
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
|
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user