Merge "Check for null drawable during LayerDrawable.jumpToCurrentState()" into nyc-dev

This commit is contained in:
TreeHugger Robot
2016-04-25 22:10:36 +00:00
committed by Android (Google) Code Review

View File

@@ -1419,9 +1419,13 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
@Override
public void jumpToCurrentState() {
final ChildDrawable[] children = mLayerState.mChildren;
for (int i = 0, count = mLayerState.mNum; i < count; i++) {
children[i].mDrawable.jumpToCurrentState();
final ChildDrawable[] array = mLayerState.mChildren;
final int N = mLayerState.mNum;
for (int i = 0; i < N; i++) {
final Drawable dr = array[i].mDrawable;
if (dr != null) {
dr.jumpToCurrentState();
}
}
}