Bug 377732 Firefox keep crashing after "Previous Session Restore" dialog,@nsRootAccessibleWrap::HandleEventWithTargetr=aaronleventhal
authorginn.chen@sun.com
Mon, 16 Apr 2007 23:15:58 -0700
changeset 580 f89bda59b409208a05b87bccbe17d9bda88a1a6d
parent 579 1d7f10ad11483eac5a70244ed18aeeef32361080
child 581 02c5cf1bc12e0a983fe11d4804cfc8cbc842af0f
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs377732
milestone1.9a4pre
Bug 377732 Firefox keep crashing after "Previous Session Restore" dialog,@nsRootAccessibleWrap::HandleEventWithTargetr=aaronleventhal
accessible/src/base/nsAccessNode.cpp
--- a/accessible/src/base/nsAccessNode.cpp
+++ b/accessible/src/base/nsAccessNode.cpp
@@ -713,28 +713,29 @@ already_AddRefed<nsIDOMNode> nsAccessNod
     return nsnull;
   }
   nsIFocusController *focusController = privateDOMWindow->GetRootFocusController();
   if (!focusController) {
     return nsnull;
   }
   nsCOMPtr<nsIDOMElement> focusedElement;
   focusController->GetFocusedElement(getter_AddRefs(focusedElement));
-  nsIDOMNode *focusedNode;
+  nsIDOMNode *focusedNode = nsnull;
   if (!focusedElement) {
     // Document itself has focus
     nsCOMPtr<nsIDOMWindowInternal> focusedWinInternal;
     focusController->GetFocusedWindow(getter_AddRefs(focusedWinInternal));
-    if (focusedWinInternal) {
-      nsCOMPtr<nsIDOMDocument> focusedDOMDocument;
-      focusedWinInternal->GetDocument(getter_AddRefs(focusedDOMDocument));
-      if (!focusedDOMDocument) {
-        return nsnull;
-      }
-      focusedDOMDocument->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&focusedNode);
+    if (!focusedWinInternal) {
+      return nsnull;
     }
+    nsCOMPtr<nsIDOMDocument> focusedDOMDocument;
+    focusedWinInternal->GetDocument(getter_AddRefs(focusedDOMDocument));
+    if (!focusedDOMDocument) {
+      return nsnull;
+    }
+    focusedDOMDocument->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&focusedNode);
   }
   else {
     focusedElement->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&focusedNode);
   }
 
   return focusedNode;
 }