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

Commit 1558cf14 authored by Romain Guy's avatar Romain Guy
Browse files

Fix crash in ShapeDrawable

Change-Id: Ibc277db46912a73dc3f971f8487baa5eafa8bc84
parent 7c026320
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -373,8 +373,16 @@ public class ShapeDrawable extends Drawable {
    @Override
    public Drawable mutate() {
        if (!mMutated && super.mutate() == this) {
            if (mShapeState.mPaint != null) {
                mShapeState.mPaint = new Paint(mShapeState.mPaint);
            } else {
                mShapeState.mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
            }
            if (mShapeState.mPadding != null) {
                mShapeState.mPadding = new Rect(mShapeState.mPadding);
            } else {
                mShapeState.mPadding = new Rect();
            }
            try {
                mShapeState.mShape = mShapeState.mShape.clone();
            } catch (CloneNotSupportedException e) {