Fix error in PR #2048: if ::available() is called before ::connect() _rxBuffer is not initialised (#2155)

This commit is contained in:
Jeroen88 2018-12-06 19:01:06 +01:00 committed by Me No Dev
parent 72803703fd
commit bff9f0b6b1

View File

@ -398,6 +398,10 @@ int WiFiClient::peek()
int WiFiClient::available()
{
if(!_rxBuffer)
{
return 0;
}
int res = _rxBuffer->available();
if(_rxBuffer->failed()) {
log_e("%d", errno);