Skip to content

Commit fdeb7d8

Browse files
committed
Serial: bool() should return false if begin() has not been called yet
1 parent 4b545d6 commit fdeb7d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/Serial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ UART::operator bool() {
200200
return SerialUSB;
201201
}
202202
#endif
203-
return 1;
203+
return _serial != NULL && _serial->obj != NULL;
204204
}
205205

206206
#if defined(SERIAL_CDC)

0 commit comments

Comments
 (0)