diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 9bec9f02f6c9..043be65f67d0 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -429,7 +429,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, if(! gInitDetector) { nsIPref* pref = nsnull; - if(NS_SUCCEEDED(webShell->GetPrefs(pref))) + if(NS_SUCCEEDED(webShell->GetPrefs(pref)) && pref) { char* detector_name = nsnull; diff --git a/layout/html/document/src/nsHTMLDocument.cpp b/layout/html/document/src/nsHTMLDocument.cpp index 9bec9f02f6c9..043be65f67d0 100644 --- a/layout/html/document/src/nsHTMLDocument.cpp +++ b/layout/html/document/src/nsHTMLDocument.cpp @@ -429,7 +429,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, if(! gInitDetector) { nsIPref* pref = nsnull; - if(NS_SUCCEEDED(webShell->GetPrefs(pref))) + if(NS_SUCCEEDED(webShell->GetPrefs(pref)) && pref) { char* detector_name = nsnull;