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

Commit d2e4264d authored by Nolan Scobie's avatar Nolan Scobie
Browse files

Add nullptr check for captureListener in captureScreenCommon

RegionSamplingThread::captureSample intentionally passes null, which is
already checked for below, but missing in this failure case of
`!renderArea`

Bug: 259021062
Test: presubmits (cost/benefit ratio of adding a new test for this seems
high, given current testing flows and simplicity of change)

Change-Id: I460539404be7a7ae434812aa1f583bba6247a812
Merged-In: I460539404be7a7ae434812aa1f583bba6247a812
parent a5c551af
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -6681,8 +6681,10 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::captureScreenCommon(
        std::unique_ptr<RenderArea> renderArea = renderAreaFuture.get();
        if (!renderArea) {
            ALOGW("Skipping screen capture because of invalid render area.");
            if (captureListener) {
                captureResults.result = NO_MEMORY;
                captureListener->onScreenCaptureCompleted(captureResults);
            }
            return ftl::yield<FenceResult>(base::unexpected(NO_ERROR)).share();
        }