Bug 351853, Crashes [@ nsFormFillController::GetDocShellForInput], adding a null check, r=dbaron

This commit is contained in:
Olli.Pettay%helsinki.fi 2006-09-11 20:10:40 +00:00
parent f162d5ee4d
commit 7e021d3aa8

View File

@ -1083,7 +1083,7 @@ nsFormFillController::GetDocShellForInput(nsIDOMHTMLInputElement *aInput)
nsCOMPtr<nsIDOMDocument> domDoc;
aInput->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
NS_ENSURE_TRUE(doc, nsnull);
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(doc->GetWindow());
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
return docShell;