From 7c5b497dd3680e952c722aab130af23b47f31423 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 15 Feb 2006 22:03:43 +0000 Subject: Guard against nsDocument::GetDefaultView returning NULL. Bug #327764. 2006-02-15 Christian Persch * embed/mozilla/EphyBrowser.cpp: Guard against nsDocument::GetDefaultView returning NULL. Bug #327764. --- embed/mozilla/EphyBrowser.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 6a97f026a..6be7da0d4 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -1286,9 +1286,12 @@ nsresult EphyBrowser::GetDocumentHasModifiedForms (nsIDOMDocument *aDomDoc, PRUi PRBool isVisible = PR_FALSE; nsresult rv; computedStyle = nsnull; - rv = defaultCSSView->GetComputedStyle (formElement, EmptyString, - getter_AddRefs (computedStyle)); - if (NS_SUCCEEDED (rv) && computedStyle) + + /* Check defaultCSSView for NULL, see bug #327764 */ + if (defaultCSSView && + NS_SUCCEEDED (defaultCSSView->GetComputedStyle (formElement, EmptyString, + getter_AddRefs (computedStyle))) && + computedStyle) { rv = computedStyle->GetPropertyCSSValue(visibilityAttr, getter_AddRefs (cssValue)); if (NS_SUCCEEDED (rv) && cssValue) @@ -1328,9 +1331,11 @@ nsresult EphyBrowser::GetDocumentHasModifiedForms (nsIDOMDocument *aDomDoc, PRUi isVisible = PR_FALSE; computedStyle = nsnull; - rv = defaultCSSView->GetComputedStyle (domElement, EmptyString, - getter_AddRefs (computedStyle)); - if (NS_SUCCEEDED (rv) && computedStyle) + /* Check defaultCSSView for NULL, see bug #327764 */ + if (defaultCSSView && + NS_SUCCEEDED (defaultCSSView->GetComputedStyle (domElement, EmptyString, + getter_AddRefs (computedStyle))) && + computedStyle) { rv = computedStyle->GetPropertyCSSValue(visibilityAttr, getter_AddRefs (cssValue)); if (NS_SUCCEEDED (rv) && cssValue) -- cgit v1.2.3