All tryToClose() methods should check for null arguments.

This commit is contained in:
akwizgran
2014-04-04 18:56:55 +01:00
parent 75f13f53a0
commit e260aac3d2
4 changed files with 10 additions and 6 deletions

View File

@@ -114,7 +114,7 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
private void tryToClose(SerialPort port) {
try {
port.closePort();
if(port != null) port.closePort();
} catch(IOException e) {
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}