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

Commit 9e01951b authored by Eric Tan's avatar Eric Tan
Browse files

Add nullptr checks in NBLog::DumpReader::handleFormat

Test: dumpsys media.log -r
Bug: 111882126
Change-Id: I04e6d3227a68e4bcde4aecbb293b02684e18c052
parent ea055e6d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -269,6 +269,15 @@ void DumpReader::dump(int fd, size_t indent)
EntryIterator DumpReader::handleFormat(const FormatEntry &fmtEntry,
        String8 *timestamp, String8 *body)
{
    String8 timestampLocal;
    String8 bodyLocal;
    if (timestamp == nullptr) {
        timestamp = &timestampLocal;
    }
    if (body == nullptr) {
        body = &bodyLocal;
    }

    // log timestamp
    const int64_t ts = fmtEntry.timestamp();
    timestamp->clear();