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

Commit 626a120f authored by Hayden Gomes's avatar Hayden Gomes Committed by Android (Google) Code Review
Browse files

Merge "Add NULL check for srcPort in supportsPatch" into sc-dev

parents 0277e91a 534685fc
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());