Prevent NPE when draw is called without bounds being set

Test: unit test inside AdaptiveIconDrawableTest.java

Change-Id: Ic3260ce9c6bae595c7eba7be1cd7ae249939a1cf
This commit is contained in:
Hyunyoung Song
2017-04-03 00:23:49 -07:00
parent 21a5edcc24
commit 55211c032c

View File

@ -304,6 +304,9 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
@Override
public void draw(Canvas canvas) {
if (mLayersBitmap == null) {
return;
}
if (mLayersShader == null) {
mCanvas.setBitmap(mLayersBitmap);
for (int i = 0; i < mLayerState.N_CHILDREN; i++) {