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

Commit 771d8f8f authored by Miranda Kephart's avatar Miranda Kephart Committed by Matt Casey
Browse files

Fix NPE in GlobalScreenshot

Bug: 167655989
Fix: 167655989
Test: take screenshot, take another while first is still up,
observe that NPE occurs. add null check, repeat, verify that NPE
does not occur.

Change-Id: I1290f3a556aba5182e3f96ce524efb86364bc3e1
parent 71f959be
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -566,7 +566,8 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
    private void saveScreenshot(Bitmap screenshot, Consumer<Uri> finisher, Rect screenRect,
            Insets screenInsets, boolean showFlash) {
        if (mScreenshotLayout.isAttachedToWindow()) {
            if (!mDismissAnimation.isRunning()) { // if we didn't already dismiss for another reason
            // if we didn't already dismiss for another reason
            if (mDismissAnimation == null || !mDismissAnimation.isRunning()) {
                mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_REENTERED);
            }
            dismissScreenshot("new screenshot requested", true);