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

Commit 942b2b5e authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

LeAudioService: Fix possible NullPointerException

Bug: 279219354
Test: compile
Tag: #feature
Change-Id: I3803f79f82e9baee5bb0c71cfd476fcc0358a287
parent 6a9c1071
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3036,6 +3036,10 @@ public class LeAudioService extends ProfileService {
     * @return the lead device of the CSIP group or {@code null} if the group does not exist
     */
    public BluetoothDevice getLeadDevice(BluetoothDevice device) {
        if (device == null) {
            Log.w(TAG, "getLeadDevice called with null device.");
            return null;
        }
        int groupId = getGroupId(device);
        if (groupId == LE_AUDIO_GROUP_ID_INVALID) {
            return null;