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

Commit 5f076a63 authored by Sally Qi's avatar Sally Qi
Browse files

Check optional before accessing the data.

This is one speculative fix to avoid crash.

Bug: 327666562
Change-Id: I212fbb6dab3bd50010de1cb795fd2b87fed8ff62
Test: builds
parent bbc6941c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -411,7 +411,8 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo, int64_t sy

    // If the previous frame was dropped we don't need to hold onto it, so
    // just keep using the previous frame's structure instead
    if (const auto reason = wasSkipped(mCurrentFrameInfo)) {
    const auto reason = wasSkipped(mCurrentFrameInfo);
    if (reason.has_value()) {
        // Use the oldest skipped frame in case we skip more than a single frame
        if (!mSkippedFrameInfo) {
            switch (*reason) {