Bug 931911 - Crash in mozilla::a11y::SelectionManager::ProcessSelectionChanged(nsISelection*). r=tbsaunde, a=bajaj
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 29 Oct 2013 23:19:04 -0400
changeset 166393 51ae975337bf251b2de9d63c8d0d26828726feb2
parent 166392 59513e28638bc71ea4cf3c82aa2806f997af63bc
child 166394 7b2d872b4496f15bc9cbd8a526691dc5c7fd663c
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde, bajaj
bugs931911
milestone27.0a2
Bug 931911 - Crash in mozilla::a11y::SelectionManager::ProcessSelectionChanged(nsISelection*). r=tbsaunde, a=bajaj
accessible/src/base/SelectionManager.cpp
--- a/accessible/src/base/SelectionManager.cpp
+++ b/accessible/src/base/SelectionManager.cpp
@@ -164,16 +164,19 @@ SelectionManager::NotifySelectionChanged
 
   return NS_OK;
 }
 
 void
 SelectionManager::ProcessSelectionChanged(nsISelection* aSelection)
 {
   Selection* selection = static_cast<Selection*>(aSelection);
+  if (!selection->GetPresShell())
+    return;
+
   const nsRange* range = selection->GetAnchorFocusRange();
   nsINode* cntrNode = nullptr;
   if (range)
     cntrNode = range->GetCommonAncestor();
   if (!cntrNode) {
     cntrNode = selection->GetFrameSelection()->GetAncestorLimiter();
     if (!cntrNode) {
       cntrNode = selection->GetPresShell()->GetDocument();