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

Commit 4069d5dc authored by yuanjiahsu's avatar yuanjiahsu
Browse files

Add nullptr check before printing found device type

Bug: 185106633
Test: manually
Change-Id: I5ed272cf29b207c2ccaaff468345dcf5c615b912
parent ff81743e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2229,7 +2229,8 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
            // Prevent from storing invalid requested device id in clients
            requestedDeviceId = AUDIO_PORT_HANDLE_NONE;
            device = mEngine->getInputDeviceForAttributes(attributes, uid, &policyMix);
            ALOGV("%s found device type is 0x%X", __FUNCTION__, device->type());
            ALOGV_IF(device != nullptr, "%s found device type is 0x%X",
                __FUNCTION__, device->type());
        }
        if (device == nullptr) {
            ALOGW("getInputForAttr() could not find device for source %d", attributes.source);