diff --git a/src/com/codebutler/android_websockets/SocketIOClient.java b/src/com/codebutler/android_websockets/SocketIOClient.java index 00a08c2..c07ee5a 100644 --- a/src/com/codebutler/android_websockets/SocketIOClient.java +++ b/src/com/codebutler/android_websockets/SocketIOClient.java @@ -267,7 +267,8 @@ public void disconnect() throws IOException { } private void cleanup() { - mClient.disconnect(); + if (mClient != null) + mClient.disconnect(); mClient = null; mSendLooper.quit();