Check fo null before using GetFocusedElement result. b=252977 r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@160494 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net 2004-08-08 17:18:58 +00:00
parent 9b18d5648a
commit 98a82b2777

View File

@ -849,8 +849,10 @@ nsWebBrowserFind::GetFrameSelection(nsIDOMWindow* aWindow,
if (focusController) {
nsCOMPtr<nsIDOMElement> focusedElement;
focusController->GetFocusedElement(getter_AddRefs(focusedElement));
nsCOMPtr<nsIContent> content(do_QueryInterface(focusedElement));
presShell->GetPrimaryFrameFor(content, &frame);
if (focusedElement) {
nsCOMPtr<nsIContent> content(do_QueryInterface(focusedElement));
presShell->GetPrimaryFrameFor(content, &frame);
}
}
}
}