Bug 717505 - Crash [@ nsAccessible::VisibilityState] when closing a tab. r=roc
authorDavid Bolter <dbolter@mozilla.com>
Mon, 23 Jan 2012 13:24:13 -0500
changeset 86349 778cf04d7c553a03043a2e77cc52655c5cc48d5b
parent 86348 e69ad50ec0d77ab7d42d9edede5653a110a3f320
child 86350 8f06957d69d9fe5e48e048d0995ecf4e4c3a0aa1
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs717505
milestone12.0a1
Bug 717505 - Crash [@ nsAccessible::VisibilityState] when closing a tab. r=roc
accessible/src/base/nsAccessible.cpp
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -611,16 +611,19 @@ nsAccessible::VisibilityState()
 
     const nsIView* view = frame->GetView();
     if (view && view->GetVisibility() == nsViewVisibility_kHide)
       return vstates;
     
   } while (accessible = accessible->Parent());
 
   nsIFrame* frame = GetFrame();
+  if (!frame)
+    return vstates;
+
   const nsCOMPtr<nsIPresShell> shell(GetPresShell());
 
   // We need to know if at least a kMinPixels around the object is visible,
   // otherwise it will be marked states::OFFSCREEN.
   const PRUint16 kMinPixels  = 12;
   const nsSize frameSize = frame->GetSize();
   const nsRectVisibility rectVisibility =
     shell->GetRectVisibility(frame, nsRect(nsPoint(0,0), frameSize),