Bug 1016875 - Part2: Ensure mDocument in ImportLoader::OnStopRequest. r=mrbkap

This commit is contained in:
Gabor Krizsanits 2014-07-16 14:31:59 +02:00
parent 6fb3e2f23c
commit 302d5f0675

View File

@ -292,6 +292,12 @@ ImportLoader::OnStopRequest(nsIRequest* aRequest,
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,