From 69b4bb092d6dca6e706e5b1f0245bbd3c682e3dd Mon Sep 17 00:00:00 2001 From: "nhotta%netscape.com" Date: Fri, 26 Jul 2002 16:45:45 +0000 Subject: [PATCH] Adding null check for mDocument before getting a document charset, bug 159434, r=caillon, sr=jst, a=asa. --- content/base/src/nsGenericElement.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index e8b6b023a131..b934a9a42254 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -2808,7 +2808,8 @@ nsGenericElement::TriggerLink(nsIPresContext* aPresContext, nsCOMPtr absURI; if (NS_SUCCEEDED(rv)) { nsAutoString docCharset; - if (NS_SUCCEEDED(mDocument->GetDocumentCharacterSet(docCharset))) + if (mDocument && + NS_SUCCEEDED(mDocument->GetDocumentCharacterSet(docCharset))) rv = NS_NewURI(getter_AddRefs(absURI), absURLSpec, NS_LossyConvertUCS2toASCII(docCharset).get(), aBaseURL); else rv = NS_NewURI(getter_AddRefs(absURI), absURLSpec, nsnull, aBaseURL);