From afefd0731b1df939b188272aba029333d0f7685b Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 27 Feb 2025 15:13:21 +0100 Subject: [PATCH] No Issue - NULL crash fix in nsExternalResourceMap::PendingLoad::OnDataAvailable Curiously, we should have had this at our fork point (as it was backported by Mozilla to 52.5.2) by apparently Tobin's import wasn't actually 52.6.0. :-/ --- dom/base/nsDocument.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 26c1025646..09146b2fe2 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -995,7 +995,8 @@ nsExternalResourceMap::PendingLoad::OnDataAvailable(nsIRequest* aRequest, 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; }