Bug 1079141 - mDocument null check in nsScriptLoader::ReadyToExecuteScripts, r=bz, a=lsblakk
authorGabor Krizsanits <gkrizsanits@mozilla.com>
Mon, 29 Dec 2014 11:44:09 -0800
changeset 234376 73145d9c6bdecc52be9e4032336af0d9ea644abf
parent 234375 7023ec60f4fbcd80b969edcb8d00d0607e055378
child 234377 a349c33ba8103e8141702dc31ce2d8fb3e896328
push id4286
push userjst@mozilla.com
push dateMon, 29 Dec 2014 19:45:45 +0000
treeherdermozilla-beta@73145d9c6bde [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, lsblakk
bugs1079141
milestone35.0
Bug 1079141 - mDocument null check in nsScriptLoader::ReadyToExecuteScripts, r=bz, a=lsblakk
content/base/src/nsScriptLoader.cpp
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -1247,17 +1247,17 @@ nsScriptLoader::ReadyToExecuteScripts()
     nsScriptLoader* ancestor = doc->ScriptLoader();
     if (!ancestor->SelfReadyToExecuteScripts() &&
         ancestor->AddPendingChildLoader(this)) {
       AddExecuteBlocker();
       return false;
     }
   }
 
-  if (!mDocument->IsMasterDocument()) {
+  if (mDocument && !mDocument->IsMasterDocument()) {
     nsRefPtr<ImportManager> im = mDocument->ImportManager();
     nsRefPtr<ImportLoader> loader = im->Find(mDocument);
     MOZ_ASSERT(loader, "How can we have an import document without a loader?");
 
     // The referring link that counts in the execution order calculation
     // (in spec: flagged as branch)
     nsCOMPtr<nsINode> referrer = loader->GetMainReferrer();
     MOZ_ASSERT(referrer, "There has to be a main referring link for each imports");