Bug 1411745 - fix crash for svg linking to mailbox URI. r=smaug a=IanN CLOSED TREE DONTBUILD SEAMONKEY_2_49_ESR_RELBRANCH
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Sat, 09 Dec 2017 16:43:16 +0200
branchSEAMONKEY_2_49_ESR_RELBRANCH
changeset 357509 49b9241e6adb01bf0e41d9154e4e48ccfc5b65c3
parent 357508 1e2abcc307fce14af9e40b05dc61914ac881064b
child 357510 a198e873c89c8453cb0f048e6e972fbb132c6568
push id7834
push userfrgrahl@gmx.net
push dateSun, 13 Jan 2019 12:17:02 +0000
treeherdermozilla-esr52@6e4ad8a8f2e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, IanN
bugs1411745
milestone52.9.1
Bug 1411745 - fix crash for svg linking to mailbox URI. r=smaug a=IanN CLOSED TREE DONTBUILD mozilla-esr52 SEAMONKEY_2_49_ESR_RELBRANCH
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1030,17 +1030,18 @@ nsExternalResourceMap::PendingLoad::Setu
 
 NS_IMETHODIMP
 nsExternalResourceMap::PendingLoad::OnDataAvailable(nsIRequest* aRequest,
                                                     nsISupports* aContext,
                                                     nsIInputStream* aStream,
                                                     uint64_t aOffset,
                                                     uint32_t aCount)
 {
-  NS_PRECONDITION(mTargetListener, "Shouldn't be getting called!");
+  // mTargetListener might be null if SetupViewer or AddExternalResource failed.
+  NS_ENSURE_TRUE(mTargetListener, NS_ERROR_FAILURE);
   if (mDisplayDocument->ExternalResourceMap().HaveShutDown()) {
     return NS_BINDING_ABORTED;
   }
   return mTargetListener->OnDataAvailable(aRequest, aContext, aStream, aOffset,
                                           aCount);
 }
 
 NS_IMETHODIMP