Merge "Fix NPE when starting advertising with null GATT"
This commit is contained in:
@@ -411,7 +411,14 @@ public final class BluetoothLeAdvertiser {
|
|||||||
try {
|
try {
|
||||||
gatt = mBluetoothManager.getBluetoothGatt();
|
gatt = mBluetoothManager.getBluetoothGatt();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Failed to get Bluetooth gatt - ", e);
|
Log.e(TAG, "Failed to get Bluetooth GATT - ", e);
|
||||||
|
postStartSetFailure(handler, callback,
|
||||||
|
AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gatt == null) {
|
||||||
|
Log.e(TAG, "Bluetooth GATT is null");
|
||||||
postStartSetFailure(handler, callback,
|
postStartSetFailure(handler, callback,
|
||||||
AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR);
|
AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user