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);
|
exception = new RuntimeException(errorMessage);
|
||||||
logger.error("HubConnection disconnected with an error {}.", errorMessage);
|
logger.error("HubConnection disconnected with an error {}.", errorMessage);
|
||||||
}
|
}
|
||||||
connectionState.cancelOutstandingInvocations(exception);
|
if (connectionState != null) {
|
||||||
connectionState = null;
|
connectionState.cancelOutstandingInvocations(exception);
|
||||||
|
connectionState = null;
|
||||||
|
}
|
||||||
|
|
||||||
logger.info("HubConnection stopped.");
|
logger.info("HubConnection stopped.");
|
||||||
hubConnectionState = HubConnectionState.DISCONNECTED;
|
hubConnectionState = HubConnectionState.DISCONNECTED;
|
||||||
handshakeResponseSubject.onComplete();
|
handshakeResponseSubject.onComplete();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue