Null check current doc before using it. b=344787 r+sr=bzbarsky

This commit is contained in:
mats.palmgren%bredband.net 2006-07-22 11:07:29 +00:00
parent 906e7b0515
commit 5ddc7604b1

View File

@ -932,11 +932,7 @@ nsHTMLFormElement::SubmitSubmission(nsIFormSubmission* aFormSubmission)
// If there is no link handler, then we won't actually be able to submit.
nsIDocument* doc = GetCurrentDoc();
if (!doc) {
// Nothing to do
}
nsCOMPtr<nsISupports> container = doc->GetContainer();
nsCOMPtr<nsISupports> container = doc ? doc->GetContainer() : nsnull;
nsCOMPtr<nsILinkHandler> linkHandler(do_QueryInterface(container));
if (!linkHandler) {
mIsSubmitting = PR_FALSE;