Skip to content

Commit 9344711

Browse files
committed
Null check
1 parent 3c8ef21 commit 9344711

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/com/codebutler/android_websockets/WebSocketClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ void sendFrame(final byte[] frame) {
209209
public void run() {
210210
try {
211211
synchronized (mSendLock) {
212+
if (mSocket == null) {
213+
throw new IllegalStateException("Socket not connected");
214+
}
212215
OutputStream outputStream = mSocket.getOutputStream();
213216
outputStream.write(frame);
214217
outputStream.flush();

0 commit comments

Comments
 (0)