avoid adding NULL UpgradeListeners to WebSocketClient

Signed-off-by: lachan-roberts <lachlan@webtide.com>
This commit is contained in:
lachan-roberts 2019-03-06 17:11:57 +11:00
parent ebbca84a87
commit ab304a096e
1 changed files with 2 additions and 1 deletions

View File

@ -135,7 +135,8 @@ public class WebSocketClient extends ContainerLifeCycle implements WebSocketPoli
public CompletableFuture<Session> connect(Object websocket, URI toUri, UpgradeRequest request, UpgradeListener listener) throws IOException
{
JettyClientUpgradeRequest upgradeRequest = new JettyClientUpgradeRequest(this, coreClient, request, toUri, websocket);
upgradeRequest.addListener(listener);
if (listener != null)
upgradeRequest.addListener(listener);
coreClient.connect(upgradeRequest);
return upgradeRequest.getFutureSession();
}