Skip to content

Commit 5d26a65

Browse files
committed
only send payload when we have a ptr and length
1 parent 007b5ba commit 5d26a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SocketIOclient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool SocketIOclient::sendEVENT(uint8_t * payload, size_t length, bool headerToPa
5959
uint8_t buf[3] = { eIOtype_MESSAGE, sIOtype_EVENT, 0x00 };
6060
ret = WebSocketsClient::write(&_client, buf, 2);
6161
}
62-
if(ret) {
62+
if(ret && payload && length > 0) {
6363
ret = WebSocketsClient::write(&_client, payload, length);
6464
}
6565
return ret;

0 commit comments

Comments
 (0)