mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Check that BluetoothSocket's input and output streams aren't null.
This commit is contained in:
@@ -33,8 +33,10 @@ class AndroidBluetoothTransportConnection
|
||||
super(plugin);
|
||||
this.connectionLimiter = connectionLimiter;
|
||||
this.socket = socket;
|
||||
in = timeoutMonitor.createTimeoutInputStream(
|
||||
socket.getInputStream(), plugin.getMaxIdleTime() * 2);
|
||||
InputStream socketIn = socket.getInputStream();
|
||||
if (socketIn == null) throw new IOException();
|
||||
in = timeoutMonitor.createTimeoutInputStream(socketIn,
|
||||
plugin.getMaxIdleTime() * 2L);
|
||||
wakeLock = wakeLockManager.createWakeLock("BluetoothConnection");
|
||||
wakeLock.acquire();
|
||||
String address = socket.getRemoteDevice().getAddress();
|
||||
@@ -48,7 +50,9 @@ class AndroidBluetoothTransportConnection
|
||||
|
||||
@Override
|
||||
protected OutputStream getOutputStream() throws IOException {
|
||||
return socket.getOutputStream();
|
||||
OutputStream socketOut = socket.getOutputStream();
|
||||
if (socketOut == null) throw new IOException();
|
||||
return socketOut;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user