diff --git a/lib/src/main/java/ua/naiksoftware/stomp/OkHttpConnectionProvider.java b/lib/src/main/java/ua/naiksoftware/stomp/OkHttpConnectionProvider.java index a7be2e3..c10fc26 100644 --- a/lib/src/main/java/ua/naiksoftware/stomp/OkHttpConnectionProvider.java +++ b/lib/src/main/java/ua/naiksoftware/stomp/OkHttpConnectionProvider.java @@ -37,7 +37,9 @@ class OkHttpConnectionProvider extends AbstractConnectionProvider { @NonNull @Override public void rawDisconnect() { - openedSocked.close(1000, ""); + if (openedSocked != null) { + openedSocked.close(1000, ""); + } } @Override