From f84208faf8e9ab7bbf81224006662fc3219c6ad4 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 13 Sep 2012 22:50:18 -0700 Subject: [PATCH] Prevent crash when invalidating all Views Bug #7165793 A ViewRootImpl's root view can be null. Check for this condition to prevent an NPE invalidateWorld(). Other messages perform a similar check to properly handle the case where mView == null. Change-Id: I5bcfc41c48a469d38b21be74df2f6c715b0f9352 --- core/java/android/view/ViewRootImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 47419bbd009c2..d6a020329932d 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -832,8 +832,8 @@ public final class ViewRootImpl implements ViewParent, void invalidateWorld(View view) { view.invalidate(); if (view instanceof ViewGroup) { - ViewGroup parent = (ViewGroup)view; - for (int i=0; i