Skip to content

Commit c54b386

Browse files
authored
Merge pull request #11 from SpigotMC/master
[pull] master from SpigotMC:master
2 parents 0f2a4fa + ed4a80e commit c54b386

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -899,19 +899,25 @@ public CompletableFuture<byte[]> sendData(String channel, byte[] data)
899899
// otherwise netty will schedule any pipeline related call by itself, this decreases performance
900900
private <T> Callback<T> eventLoopCallback(Callback<T> callback)
901901
{
902-
EventLoop eventLoop = ch.getHandle().eventLoop();
903-
return eventLoop.inEventLoop() ? (result, error) ->
902+
return (result, error) ->
904903
{
905-
if ( !ch.isClosing() )
904+
EventLoop eventLoop = ch.getHandle().eventLoop();
905+
if ( eventLoop.inEventLoop() )
906906
{
907-
callback.done( result, error );
907+
if ( !ch.isClosing() )
908+
{
909+
callback.done( result, error );
910+
}
911+
return;
908912
}
909-
} : (result, error) -> eventLoop.execute( () ->
910-
{
911-
if ( !ch.isClosing() )
913+
914+
eventLoop.execute( () ->
912915
{
913-
callback.done( result, error );
914-
}
915-
} );
916+
if ( !ch.isClosing() )
917+
{
918+
callback.done( result, error );
919+
}
920+
} );
921+
};
916922
}
917923
}

0 commit comments

Comments
 (0)