Bug 506637 nsFocusController::GetControllers does not handle a null nsIFocusManager* fm well

r=smaug
This commit is contained in:
timeless@mozdev.org 2009-08-12 11:49:55 +02:00
Родитель 0fcff0c86c
Коммит 5a625c1127
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -98,9 +98,12 @@ nsFocusController::GetControllers(nsIControllers** aResult)
// knowledge of what object might have controllers.
nsCOMPtr<nsIDOMElement> focusedElement;
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm)
fm->GetFocusedElement(getter_AddRefs(focusedElement));
if (!fm) {
*aResult = nsnull;
return NS_OK;
}
fm->GetFocusedElement(getter_AddRefs(focusedElement));
if (focusedElement) {
#ifdef MOZ_XUL
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(focusedElement));