Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f014f40 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix NPE when starting advertising with null GATT

Bug: 112164168
Change-Id: I82be0e06e990cc116d3ab48de80b5bb170d69892
parent c874462c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -411,7 +411,14 @@ public final class BluetoothLeAdvertiser {
        try {
            gatt = mBluetoothManager.getBluetoothGatt();
        } 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,
                    AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR);
            return;