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

Commit 0269068c authored by Yunlian Jiang's avatar Yunlian Jiang Committed by George Burgess IV
Browse files

fix warning: dereference of a null pointer

This fixes a warning: Access to field 'mPlaybackFormats' results
in a dereference of a null pointer (loaded from field 'mDeviceInfo')
[clang-analyzer-core.NullDereference]

Bug: None
Test: Static analyzer no longer complains, bullhead still boots with no
apparent issues.
Change-Id: I71ce486c667441d9b90ef63c2df8d23d70254639
parent f41c781c
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -263,7 +263,9 @@ void MtpDevice::close() {
}

void MtpDevice::print() {
    if (mDeviceInfo) {
    if (!mDeviceInfo)
        return;

    mDeviceInfo->print();

    if (mDeviceInfo->mDeviceProperties) {
@@ -278,7 +280,6 @@ void MtpDevice::print() {
            }
        }
    }
    }

    if (mDeviceInfo->mPlaybackFormats) {
            ALOGI("***** OBJECT PROPERTIES *****\n");