Bug 1016875 - Part2: Ensure mDocument in ImportLoader::OnStopRequest. r=mrbkap
authorGabor Krizsanits <gkrizsanits@mozilla.com>
Wed, 16 Jul 2014 14:31:59 +0200
changeset 216288 6c958a605ac1397f15bb28b17eed667e8e8e1db5
parent 216287 98c0de173604a00a02726a61cf5d6cbe8fc40c24
child 216289 c7d87f38aeefa582e9609848328d1b75a132b17a
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1016875
milestone33.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 1016875 - Part2: Ensure mDocument in ImportLoader::OnStopRequest. r=mrbkap
content/base/src/ImportManager.cpp
--- a/content/base/src/ImportManager.cpp
+++ b/content/base/src/ImportManager.cpp
@@ -287,16 +287,22 @@ ImportLoader::OnStopRequest(nsIRequest* 
 
   MOZ_ASSERT(aRequest == mChannel,
              "Wrong channel something went horribly wrong");
 
   if (mParserStreamListener) {
     mParserStreamListener->OnStopRequest(aRequest, aContext, aStatus);
   }
 
+  if (!mDocument) {
+    // If at this point we don't have a document, then the error was
+    // already reported.
+    return NS_ERROR_DOM_ABORT_ERR;
+  }
+
   nsCOMPtr<EventTarget> eventTarget = do_QueryInterface(mDocument);
   EventListenerManager* manager = eventTarget->GetOrCreateListenerManager();
   manager->AddEventListenerByType(this,
                                   NS_LITERAL_STRING("DOMContentLoaded"),
                                   TrustedEventsAtSystemGroupBubble());
   return NS_OK;
 }