diff --git a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java index aea9cf83e5a..dee0d964f95 100644 --- a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java +++ b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java @@ -66,8 +66,11 @@ private String getApiUrl() { @Override public Completable disconnect() { - streamingService.pingPongDisconnectIfConnected(); - return streamingService.disconnect(); + if(streamingService != null) { + streamingService.pingPongDisconnectIfConnected(); + return streamingService.disconnect(); + } + return null; } @Override