mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 12:49:55 +01:00
All tryToClose() methods should check for null arguments.
This commit is contained in:
@@ -339,7 +339,7 @@ class BluetoothPlugin implements DuplexPlugin {
|
||||
|
||||
private void tryToClose(StreamConnection s) {
|
||||
try {
|
||||
s.close();
|
||||
if(s != null) s.close();
|
||||
} catch(IOException e) {
|
||||
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
|
||||
|
||||
private void tryToClose(SerialPort port) {
|
||||
try {
|
||||
port.closePort();
|
||||
if(port != null) port.closePort();
|
||||
} catch(IOException e) {
|
||||
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user