Skip to content

Commit 3da0885

Browse files
author
Kristijan Sedlak
committed
preventing send & crash when not connected in WSC
1 parent 5c88070 commit 3da0885

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/net/tootallnate/websocket/WebSocketClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public void close() throws IOException
133133
* @throws IOException When socket related I/O errors occur.
134134
*/
135135
public void send(String text) throws IOException {
136-
if (conn != null) {
136+
if (conn != null && client.isConnected())
137+
{
137138
conn.send(text);
138139
}
139140
}

0 commit comments

Comments
 (0)