Description
Currently, if(Serial) always returns true which is specified in the documentation (https://www.arduino.cc/en/Serial/IfSerial) but contradicts the purpose considering that on 32u4 based boards with USB serial it's used to check if the serial port is ready. This breaks interchangability between the platforms.
For the SoftwareSerial library it would be an easy change when changing the code from
operator bool() { return true; }
to
operator bool() { return isListening(); }
For HardwareSerial, it's not so easy but maybe even more important, because it crashes when accessing read and print before initializing the library with begin(). I'm not sure what would be the best way to implement it or what's the Arduino style of handling this, so I didn't include a pull request.