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

Commit 94ada23d authored by Jiabin Huang's avatar Jiabin Huang
Browse files

Check if device is null before checking its type is echo reference.

Bug: 388333862
Change-Id: If039db3347387d3df4b833a6b03bcba70a21d5ee
Test: atest AAudioTests
Flag: EXEMPT bugfix
parent 721db6f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -930,7 +930,7 @@ sp<DeviceDescriptor> Engine::getInputDeviceForAttributes(const audio_attributes_

    device = getDeviceForInputSource(attr.source);

    if (device->type() == AUDIO_DEVICE_IN_ECHO_REFERENCE) {
    if (device != nullptr && device->type() == AUDIO_DEVICE_IN_ECHO_REFERENCE) {
        sp<DeviceDescriptor> device2 = getInputDeviceForEchoRef(attr, availableInputDevices);
        if (device2 != nullptr) {
            return device2;