If port name == null, exception with TYPE_NULL_NOT_PERMITTED will be thrown. Previous code with throwing TYPE_PORT_NOT_FOUND exception not a good idea as I think

This commit is contained in:
Alexey Sokolov 2013-04-11 10:26:41 +03:00
parent 2819f0ceaf
commit 821c2a1884
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ public class SerialPort {
portHandle = serialInterface.openPort(portName);
}
else {
portHandle = -2;//->Since 2.1.0 NULL port name fix
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_NULL_NOT_PERMITTED);//since 2.1.0 -> NULL port name fix
}
//since 0.9.0 ->
if(portHandle == -1){