Ensure port handle is valid before reconfiguring timeouts
This commit is contained in:
parent
01d0fdfe80
commit
91a9c0cf72
|
@ -1017,7 +1017,8 @@ public final class SerialPort
|
||||||
{
|
{
|
||||||
serialEventListener.stopListening();
|
serialEventListener.stopListening();
|
||||||
serialEventListener = null;
|
serialEventListener = null;
|
||||||
configTimeouts(portHandle, timeoutMode, readTimeout, writeTimeout, eventFlags);
|
if (portHandle != 0)
|
||||||
|
configTimeouts(portHandle, timeoutMode, readTimeout, writeTimeout, eventFlags);
|
||||||
}
|
}
|
||||||
userDataListener = null;
|
userDataListener = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue