prevent null pointer exception
This commit is contained in:
parent
73fbac1bae
commit
d841ff5098
2 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ public class ExecutionService extends Service {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
|
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
|
||||||
log.debug("Device has disconnected " + device.getName());//Device has disconnected
|
log.debug("Device has disconnected " + device.getName());//Device has disconnected
|
||||||
if (mBTDevice != null && mBTDevice.getName().equals(device.getName())) {
|
if (mBTDevice != null && mBTDevice.getName() != null && mBTDevice.getName().equals(device.getName())) {
|
||||||
if (mSerialIOThread != null) {
|
if (mSerialIOThread != null) {
|
||||||
mSerialIOThread.disconnect("BT disconnection broadcast");
|
mSerialIOThread.disconnect("BT disconnection broadcast");
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class ExecutionService extends Service {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
|
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
|
||||||
log.debug("Device has disconnected " + device.getName());//Device has disconnected
|
log.debug("Device has disconnected " + device.getName());//Device has disconnected
|
||||||
if (mBTDevice != null && mBTDevice.getName().equals(device.getName())) {
|
if (mBTDevice != null && mBTDevice.getName() != null && mBTDevice.getName().equals(device.getName())) {
|
||||||
if (mSerialIOThread != null) {
|
if (mSerialIOThread != null) {
|
||||||
mSerialIOThread.disconnect("BT disconnection broadcast");
|
mSerialIOThread.disconnect("BT disconnection broadcast");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue