Skip to content

Commit 51d7100

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Prevent crash when invalidating all Views Bug #7165793" into jb-mr1-dev
2 parents cd6e7e1 + f84208f commit 51d7100

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/java/android/view/ViewRootImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ void invalidate() {
832832
void invalidateWorld(View view) {
833833
view.invalidate();
834834
if (view instanceof ViewGroup) {
835-
ViewGroup parent = (ViewGroup)view;
836-
for (int i=0; i<parent.getChildCount(); i++) {
835+
ViewGroup parent = (ViewGroup) view;
836+
for (int i = 0; i < parent.getChildCount(); i++) {
837837
invalidateWorld(parent.getChildAt(i));
838838
}
839839
}
@@ -2998,7 +2998,9 @@ public void handleMessage(Message msg) {
29982998
handleDispatchDoneAnimating();
29992999
} break;
30003000
case MSG_INVALIDATE_WORLD: {
3001-
invalidateWorld(mView);
3001+
if (mView != null) {
3002+
invalidateWorld(mView);
3003+
}
30023004
} break;
30033005
}
30043006
}

0 commit comments

Comments
 (0)