Fixed abrupt crash if BLE address is empty string, and created testing version of V3.5.0

This commit is contained in:
Graham Jones
2020-08-22 11:43:51 +01:00
parent 47d6df65a0
commit 62e19e6ebe
5 changed files with 9 additions and 3 deletions

View File

@@ -149,7 +149,13 @@ public class SdDataSourceBLE extends SdDataSource {
return;
}
final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(mBleDeviceAddr);
BluetoothDevice device;
try {
device = mBluetoothAdapter.getRemoteDevice(mBleDeviceAddr);
} catch (Exception e) {
Log.w(TAG, "bleConnect(): Error connecting to device address "+mBleDeviceAddr+".");
device = null;
}
if (device == null) {
Log.w(TAG, "bleConnect(): Device not found. Unable to connect.");
return;