From 821c2a18841aee4e55edbe39eab758b44fae2dd7 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 11 Apr 2013 10:26:41 +0300 Subject: [PATCH] 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 --- src/java/jssc/SerialPort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/jssc/SerialPort.java b/src/java/jssc/SerialPort.java index 57c0b45..a162480 100644 --- a/src/java/jssc/SerialPort.java +++ b/src/java/jssc/SerialPort.java @@ -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){