diff --git a/cores/common/arduino/libraries/api/Serial/Serial.cpp b/cores/common/arduino/libraries/api/Serial/Serial.cpp index 509d3539b..d9a3cb46d 100644 --- a/cores/common/arduino/libraries/api/Serial/Serial.cpp +++ b/cores/common/arduino/libraries/api/Serial/Serial.cpp @@ -24,7 +24,7 @@ void SerialClass::adrParse(uint8_t c) { #endif int SerialClass::available() { - return this->buf && this->buf->available(); + return this->buf ? this->buf->available() : 0; } int SerialClass::peek() {