Check connectionState in stop so we don't null ref (#4557)
This commit is contained in:
parent
97cdbfb1a1
commit
ff385f71c5
|
|
@ -436,8 +436,11 @@ public class HubConnection {
|
|||
exception = new RuntimeException(errorMessage);
|
||||
logger.error("HubConnection disconnected with an error {}.", errorMessage);
|
||||
}
|
||||
connectionState.cancelOutstandingInvocations(exception);
|
||||
connectionState = null;
|
||||
if (connectionState != null) {
|
||||
connectionState.cancelOutstandingInvocations(exception);
|
||||
connectionState = null;
|
||||
}
|
||||
|
||||
logger.info("HubConnection stopped.");
|
||||
hubConnectionState = HubConnectionState.DISCONNECTED;
|
||||
handshakeResponseSubject.onComplete();
|
||||
|
|
|
|||
Loading…
Reference in New Issue