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

Commit d0e462e3 authored by Sergey Prigogin's avatar Sergey Prigogin
Browse files

Fix a NPE with outlineProvider="none"

Do not attempt to draw outline when outline provider is null.

Test: manually follow the steps in https://b.corp.google.com/issues/37139123#comment1
Bug: https://issuetracker.google.com/37139123



Change-Id: I6e09c187d5a8e1364e2ecbe12bbb5a17ad057965
Signed-off-by: default avatarSergey Prigogin <sprigogin@google.com>
parent 4c4a55a6
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -50,6 +50,7 @@ public class ViewGroup_Delegate {
            // the outline obtained is correct.
            // the outline obtained is correct.
            child.setBackgroundBounds();
            child.setBackgroundBounds();
            ViewOutlineProvider outlineProvider = child.getOutlineProvider();
            ViewOutlineProvider outlineProvider = child.getOutlineProvider();
            if (outlineProvider != null) {
                Outline outline = child.mAttachInfo.mTmpOutline;
                Outline outline = child.mAttachInfo.mTmpOutline;
                outlineProvider.getOutline(child, outline);
                outlineProvider.getOutline(child, outline);
                if (outline.mPath != null || (outline.mRect != null && !outline.mRect.isEmpty())) {
                if (outline.mPath != null || (outline.mRect != null && !outline.mRect.isEmpty())) {
@@ -58,6 +59,7 @@ public class ViewGroup_Delegate {
                    canvas.restoreToCount(restoreTo);
                    canvas.restoreToCount(restoreTo);
                }
                }
            }
            }
        }
        return thisVG.drawChild_Original(canvas, child, drawingTime);
        return thisVG.drawChild_Original(canvas, child, drawingTime);
    }
    }