Skip to content

Commit aeb04e5

Browse files
committed
2 parents 0b98aea + 710eefd commit aeb04e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/org/java_websocket/client/WebSocketClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private final void interruptableRun() {
260260
} catch ( IOException e ) {
261261
onError( e );
262262
conn.close( CloseFrame.ABNORMAL_CLOSE );
263-
} catch ( RuntimeException e ) {
263+
} catch ( RuntimeException e ) {
264264
// this catch case covers internal errors only and indicates a bug in this websocket implementation
265265
onError( e );
266266
conn.eot( e );
@@ -315,6 +315,9 @@ private void sendHandshake() throws IOException , InvalidHandshakeException , In
315315
* @return Returns '0 = CONNECTING', '1 = OPEN', '2 = CLOSING' or '3 = CLOSED'
316316
*/
317317
public int getReadyState() {
318+
if (conn == null) {
319+
return WebSocket.READY_STATE_CONNECTING;
320+
}
318321
return conn.getReadyState();
319322
}
320323

0 commit comments

Comments
 (0)