Bug 779917 - Null check followup.
authorCameron McCormack <cam@mcc.id.au>
Wed, 26 Dec 2012 20:00:19 +1100
changeset 117033 0b0b040b16d8a1a3ba3192834dcd78a5c243cc8f
parent 117032 a981b50c1d43e18b121e86ce6e763e8a5961fdbf
child 117034 9059edd199b27f8afb49e09c2e43658fdc503015
child 117040 f5ed2691d90175609bf6505245bc3304c84245ed
push id20268
push usercmccormack@mozilla.com
push dateWed, 26 Dec 2012 09:00:27 +0000
treeherdermozilla-inbound@0b0b040b16d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs779917
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 779917 - Null check followup.
layout/style/CSS.cpp
--- a/layout/style/CSS.cpp
+++ b/layout/style/CSS.cpp
@@ -23,16 +23,20 @@ struct SupportsParsingInfo
   nsIURI* mBaseURI;
   nsIPrincipal* mPrincipal;
 };
 
 static nsresult
 GetParsingInfo(nsISupports* aGlobal,
                SupportsParsingInfo& aInfo)
 {
+  if (!aGlobal) {
+    return NS_ERROR_FAILURE;
+  }
+
   nsGlobalWindow* win = nsGlobalWindow::FromSupports(aGlobal);
   nsCOMPtr<nsIDocument> doc = win->GetDoc();
   if (!doc) {
     return NS_ERROR_FAILURE;
   }
 
   aInfo.mDocURI = nsCOMPtr<nsIURI>(doc->GetDocumentURI());
   aInfo.mBaseURI = nsCOMPtr<nsIURI>(doc->GetBaseURI());