Prevent NPE when draw is called without bounds being set
Test: unit test inside AdaptiveIconDrawableTest.java Change-Id: Ic3260ce9c6bae595c7eba7be1cd7ae249939a1cf
This commit is contained in:
@ -304,6 +304,9 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(Canvas canvas) {
|
||||||
|
if (mLayersBitmap == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mLayersShader == null) {
|
if (mLayersShader == null) {
|
||||||
mCanvas.setBitmap(mLayersBitmap);
|
mCanvas.setBitmap(mLayersBitmap);
|
||||||
for (int i = 0; i < mLayerState.N_CHILDREN; i++) {
|
for (int i = 0; i < mLayerState.N_CHILDREN; i++) {
|
||||||
|
Reference in New Issue
Block a user