Skip to content

Commit 26f6253

Browse files
committed
Fixing possible use of null pointer
1 parent edc75e4 commit 26f6253

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/AsyncEventSource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ bool AsyncEventSourceClient::_queueMessage(AsyncEvent_SharedData_t &&msg) {
243243
forcing Q run will only eat more heap ram and blow the buffer, let's just keep data in our own queue
244244
the queue will be processed at least on each onAck()/onPoll() call from AsyncTCP
245245
*/
246-
if (_messageQueue.size() < SSE_MAX_QUEUED_MESSAGES >> 2 && _client->canSend()) {
246+
if (_messageQueue.size() < SSE_MAX_QUEUED_MESSAGES >> 2 && _client && _client->canSend()) {
247247
_runQueue();
248248
}
249249
return true;
@@ -334,7 +334,7 @@ void AsyncEventSourceClient::_runQueue() {
334334
}
335335

336336
// flush socket
337-
if (total_bytes_written) {
337+
if (total_bytes_written && _client) {
338338
_client->send();
339339
}
340340
}

0 commit comments

Comments
 (0)