Bug 1055456 - Add null check to fix crash in [@ nsTypeAheadFind::GetSearchContainers]. r=mrbkap
authorOlli Pettay <bugs@pettay.fi>
Wed, 27 Aug 2014 08:21:00 -0400
changeset 224969 47f8093426c42688e3bab8e1cdedbb106e48e70b
parent 224968 82acd6f569ec652a09b390c4a82a761fcab3b91e
child 224970 1a645efe3d6af019971862f81006ff14d4cb2a97
push id583
push userbhearsum@mozilla.com
push dateMon, 24 Nov 2014 19:04:58 +0000
treeherdermozilla-release@c107e74250f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1055456
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1055456 - Add null check to fix crash in [@ nsTypeAheadFind::GetSearchContainers]. r=mrbkap
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -754,19 +754,19 @@ nsTypeAheadFind::GetSearchContainers(nsI
 
   // Hack for XMLPrettyPrinter. nsFind can't handle complex anonymous content.
   // If the root node has an XBL binding then there's not much we can do in
   // in general, but we can try searching the binding's first child, which
   // in the case of XMLPrettyPrinter contains the visible pretty-printed
   // content.
   nsXBLBinding* binding = rootContent->GetXBLBinding();
   if (binding) {
-    nsIContent* child = binding->GetAnonymousContent()->GetFirstChild();
-    if (child) {
-      searchRootNode = do_QueryInterface(child);
+    nsIContent* anonContent = binding->GetAnonymousContent();
+    if (anonContent) {
+      searchRootNode = do_QueryInterface(anonContent->GetFirstChild());
     }
   }
   mSearchRange->SelectNodeContents(searchRootNode);
 
   if (!mStartPointRange) {
     mStartPointRange = new nsRange(doc);
   }
   mStartPointRange->SetStart(searchRootNode, 0);