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

Commit e66be622 authored by sergeyv's avatar sergeyv
Browse files

Fix NPE while using mLayerPaint

bug:27873847
Change-Id: I9bfae72dfa9bda45fdeb94544b7656e2584f29f6
parent 342a7e6a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -16855,11 +16855,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            } else {
                // use layer paint to draw the bitmap, merging the two alphas, but also restore
                int layerPaintAlpha = mLayerPaint != null ? mLayerPaint.getAlpha() : 255;
                if (mLayerPaint == null && alpha < 1) {
                    mLayerPaint = new Paint();
                    mLayerPaint.setAlpha((int) (alpha * layerPaintAlpha));
                }
                canvas.drawBitmap(cache, 0.0f, 0.0f, mLayerPaint);
                if (mLayerPaint != null) {
                    mLayerPaint.setAlpha(layerPaintAlpha);
                }
            }
        }
        if (restoreTo >= 0) {
            canvas.restoreToCount(restoreTo);