Fix error in PR #2048: if ::available() is called before ::connect() _rxBuffer is not initialised (#2155)
This commit is contained in:
parent
72803703fd
commit
bff9f0b6b1
@ -398,6 +398,10 @@ int WiFiClient::peek()
|
|||||||
|
|
||||||
int WiFiClient::available()
|
int WiFiClient::available()
|
||||||
{
|
{
|
||||||
|
if(!_rxBuffer)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int res = _rxBuffer->available();
|
int res = _rxBuffer->available();
|
||||||
if(_rxBuffer->failed()) {
|
if(_rxBuffer->failed()) {
|
||||||
log_e("%d", errno);
|
log_e("%d", errno);
|
||||||
|
Loading…
Reference in New Issue
Block a user