mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Don't try to close the serial port if it wasn't opened.
This commit is contained in:
@@ -56,6 +56,10 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
|
||||
try {
|
||||
if(!port.openPort())
|
||||
throw new IOException("Failed to open serial port");
|
||||
} catch(SerialPortException e) {
|
||||
throw new IOException(e.toString());
|
||||
}
|
||||
try {
|
||||
boolean foundBaudRate = false;
|
||||
for(int baudRate : BAUD_RATES) {
|
||||
if(port.setParams(baudRate, 8, 1, 0)) {
|
||||
|
||||
Reference in New Issue
Block a user