From 5ddc7604b11d39e8e26a077369409d463c9b9f21 Mon Sep 17 00:00:00 2001 From: "mats.palmgren%bredband.net" Date: Sat, 22 Jul 2006 11:07:29 +0000 Subject: [PATCH] Null check current doc before using it. b=344787 r+sr=bzbarsky --- content/html/content/src/nsHTMLFormElement.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 02dc6775e224..808495bd7e82 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -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 container = doc->GetContainer(); + nsCOMPtr container = doc ? doc->GetContainer() : nsnull; nsCOMPtr linkHandler(do_QueryInterface(container)); if (!linkHandler) { mIsSubmitting = PR_FALSE;