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

Commit 95b7770a authored by Krzysztof Kopyściński's avatar Krzysztof Kopyściński
Browse files

CallAudioRouteController: fix possible null pointer dereference in onAvailableRoutesChanged()

If the device was disconnected at the time as onAvailableRoutesChanged()
was called, `deviceToAdd` may be NULL.

Bug: b/368222213
Test: Manual
Change-Id: I30bec44956c8f0790114dbc9672d598c2d1291eb
parent 0ca20d2f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -957,7 +957,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
                    BluetoothDevice deviceToAdd = mBluetoothRoutes.get(route);
                    // Only include the lead device for LE audio (otherwise, the routes will show
                    // two separate devices in the UI).
                    if (route.getType() == AudioRoute.TYPE_BLUETOOTH_LE
                    if (deviceToAdd != null && route.getType() == AudioRoute.TYPE_BLUETOOTH_LE
                            && getLeAudioService() != null) {
                        int groupId = getLeAudioService().getGroupId(deviceToAdd);
                        if (groupId != BluetoothLeAudio.GROUP_ID_INVALID) {