Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from SpigotMC/master
Browse files Browse the repository at this point in the history
Throw exception when ServerConnectEvent is handled badly
  • Loading branch information
John authored Nov 25, 2016
2 parents 5052efc + 4d004d5 commit 6bb65b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxy/src/main/java/net/md_5/bungee/UserConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void connect(ServerInfo target, Callback<Boolean> callback)
public void connectNow(ServerInfo target)
{
dimensionChange = true;
connect(target);
connect( target );
}

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)
Expand Down Expand Up @@ -256,6 +256,11 @@ public void connect(ServerInfo info, final Callback<Boolean> callback, final boo
{
callback.done( false, null );
}

if ( getServer() == null && !ch.isClosing() )
{
throw new IllegalStateException("Cancelled ServerConnectEvent with no server or disconnect.");
}
return;
}

Expand Down

0 comments on commit 6bb65b3

Please sign in to comment.