Bug 468659 - Crash [@ nsAccessNode::GetDocAccessibleFor(nsIDocShellTreeItem*, int) ], r=surkov, marcoz
authorDavid Bolter<bolterbugz@gmail.com>
Thu, 30 Jul 2009 20:43:20 +0800
changeset 26178 017b8cd48bedcd54d19ca515f59b27e055fd9ba0
parent 26177 11c8d9d05e2e4182e2b545ecd4c4c0e4008388e4
child 26182 83d2f8008e677e0a9063e98c018833fe11e8e757
push id1842
push usersurkov.alexander@gmail.com
push dateThu, 30 Jul 2009 11:44:13 +0000
reviewerssurkov, marcoz
bugs468659
milestone1.9.1.3pre
Bug 468659 - Crash [@ nsAccessNode::GetDocAccessibleFor(nsIDocShellTreeItem*, int) ], r=surkov, marcoz
accessible/src/base/nsAccessNode.cpp
--- a/accessible/src/base/nsAccessNode.cpp
+++ b/accessible/src/base/nsAccessNode.cpp
@@ -700,18 +700,22 @@ nsAccessNode::GetDocAccessibleFor(nsIDoc
     return presShell ? GetDocAccessibleFor(presShell->GetDocument()) : nsnull;
   }
 
   nsCOMPtr<nsIDOMNode> node = nsCoreUtils::GetDOMNodeForContainer(aContainer);
   if (!node) {
     return nsnull;
   }
 
+  nsCOMPtr<nsIAccessibilityService> accService = GetAccService();
+  if (!accService)
+    return nsnull;
+  
   nsCOMPtr<nsIAccessible> accessible;
-  GetAccService()->GetAccessibleFor(node, getter_AddRefs(accessible));
+  accService->GetAccessibleFor(node, getter_AddRefs(accessible));
   nsIAccessibleDocument *docAccessible = nsnull;
   if (accessible) {
     CallQueryInterface(accessible, &docAccessible);
   }
   return docAccessible;
 }
  
 already_AddRefed<nsIAccessibleDocument>