diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index e6e448cb..0383c149 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -921,13 +921,16 @@ String HTTPClient::getString(void) { StreamString sstring; - if(_size) { + if(_size > 0) { // try to reserve needed memmory if(!sstring.reserve((_size + 1))) { log_d("not enough memory to reserve a string! need: %d", (_size + 1)); return ""; } } + else { + return ""; + } writeToStream(&sstring); return sstring;