Skip to content

Commit e0ddfd2

Browse files
committed
Bugfix: Invalid return when response is an empty string
1 parent 87a417d commit e0ddfd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ int UniversalTelegramBot::getUpdates(long offset) {
299299
}
300300
String response = sendGetToTelegram(command); //receive reply from telegram.org
301301

302-
if (response != "") {
302+
if (response == "") {
303+
if(_debug) Serial.println(F("Received empty string in response!"));
304+
return 0;
305+
}
306+
else {
303307
if (_debug) {
304308
Serial.print("incoming message length");
305309
Serial.println(response.length());

0 commit comments

Comments
 (0)