mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +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 {
|
try {
|
||||||
if(!port.openPort())
|
if(!port.openPort())
|
||||||
throw new IOException("Failed to open serial port");
|
throw new IOException("Failed to open serial port");
|
||||||
|
} catch(SerialPortException e) {
|
||||||
|
throw new IOException(e.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
boolean foundBaudRate = false;
|
boolean foundBaudRate = false;
|
||||||
for(int baudRate : BAUD_RATES) {
|
for(int baudRate : BAUD_RATES) {
|
||||||
if(port.setParams(baudRate, 8, 1, 0)) {
|
if(port.setParams(baudRate, 8, 1, 0)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user