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

Commit 534685fc authored by Hayden Gomes's avatar Hayden Gomes
Browse files

Add NULL check for srcPort in supportsPatch

Bug: 182812093
Test: Ran on device that was previously failing and placed phone call
Change-Id: Ia371c915565052fcd2094c0b21694ef2d9fa6a68
parent 18511ee7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public:

    bool equals(const sp<PolicyAudioPort> &right) const
    {
        return getTagName() == right->getTagName();
        return right != 0 && getTagName() == right->getTagName();
    }

    virtual sp<AudioPort> asAudioPort() const = 0;
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ void AudioRoute::dump(String8 *dst, int spaces) const
bool AudioRoute::supportsPatch(const sp<PolicyAudioPort> &srcPort,
                               const sp<PolicyAudioPort> &dstPort) const
{
    if (mSink == 0 || dstPort == 0 || !dstPort->equals(mSink)) {
    if (mSink == 0 || srcPort == 0 || dstPort == 0 || !dstPort->equals(mSink)) {
        return false;
    }
    ALOGV("%s: sinks %s matching", __FUNCTION__, mSink->getTagName().c_str());