Skip to content

Commit 8a5b783

Browse files
Jason2866me-no-devlucasssvaz
authored
Bugfix/wificlient (#273)
* WiFiClient - Properly initialize and check _rxBuffer --------- Co-authored-by: Me No Dev <[email protected]> Co-authored-by: Lucas Saavedra Vaz <[email protected]>
1 parent 31325f4 commit 8a5b783

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v2.0.13
45+
- v2.0.12
4446
- v2.0.11
4547
- v2.0.10
4648
- v2.0.9

libraries/WiFi/src/WiFiClient.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class WiFiClientSocketHandle {
187187
}
188188
};
189189

190-
WiFiClient::WiFiClient():_connected(false),_timeout(WIFI_CLIENT_DEF_CONN_TIMEOUT_MS),next(NULL)
190+
WiFiClient::WiFiClient():_rxBuffer(nullptr),_connected(false),_timeout(WIFI_CLIENT_DEF_CONN_TIMEOUT_MS),next(NULL)
191191
{
192192
}
193193

@@ -536,7 +536,9 @@ int WiFiClient::available()
536536
// Though flushing means to send all pending data,
537537
// seems that in Arduino it also means to clear RX
538538
void WiFiClient::flush() {
539-
_rxBuffer->flush();
539+
if (_rxBuffer != nullptr) {
540+
_rxBuffer->flush();
541+
}
540542
}
541543

542544
uint8_t WiFiClient::connected()

0 commit comments

Comments
 (0)