From 0044aa9e9b6ebbb2703870effbbad52d4b0f05f9 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Wed, 26 Mar 2014 16:17:15 -0400 Subject: [PATCH] Bug 987026 - Crash when adopting a focused element [@ mozilla::a11y::FocusManager::ProcessDOMFocus], r=jwei --- accessible/src/base/FocusManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accessible/src/base/FocusManager.cpp b/accessible/src/base/FocusManager.cpp index 24ab912e3495..eaf477352370 100644 --- a/accessible/src/base/FocusManager.cpp +++ b/accessible/src/base/FocusManager.cpp @@ -240,9 +240,11 @@ FocusManager::ProcessDOMFocus(nsINode* aTarget) DocAccessible* document = GetAccService()->GetDocAccessible(aTarget->OwnerDoc()); + if (!document) + return; Accessible* target = document->GetAccessibleEvenIfNotInMapOrContainer(aTarget); - if (target && document) { + if (target) { // Check if still focused. Otherwise we can end up with storing the active // item for control that isn't focused anymore. nsINode* focusedNode = FocusedDOMNode();