summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Kirk <askirk@umich.edu>2017-01-24 14:34:19 -0500
committerAustin Kirk <askirk@umich.edu>2017-01-24 14:34:19 -0500
commit3517dbd66adc1e0abdced9da51200516ee1a4c82 (patch)
tree648d5b0d86bdb25d2799552433ddac5df56c5e9f
parent5a5ad935e708f6160a77c61801e756284921cbc8 (diff)
downloadsdl_android-3517dbd66adc1e0abdced9da51200516ee1a4c82.tar.gz
Handling NULL mmInStreambugfix/issue_380
-addresses cases where mmInStream is null
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/transport/MultiplexBluetoothTransport.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/transport/MultiplexBluetoothTransport.java b/sdl_android_lib/src/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
index f2ddf2a52..4efcc5634 100644
--- a/sdl_android_lib/src/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
+++ b/sdl_android_lib/src/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
@@ -805,7 +805,7 @@ public class MultiplexBluetoothTransport {
psm.reset();
}
- }catch (IOException e){
+ } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
Log.e(TAG, "Lost connection in the Connected Thread");
e.printStackTrace();
connectionLost();
@@ -825,9 +825,9 @@ public class MultiplexBluetoothTransport {
mmSocket.close();
}
- } catch (IOException e) {
- //Log.trace(TAG, "Read Thread: " + e.getMessage());
-
+ } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
+ // Log.trace(TAG, "Read Thread: " + e.getMessage());
+ // Socket or stream is already closed
}
}
}