From bc50a7d3c6d8e03f99b64852c58ed8b7cc73a07c Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 19 Feb 2023 13:10:29 +0100 Subject: [PATCH] [DOM] Check whether module load request was already cancelled when a load fails --- dom/script/ModuleLoadRequest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/script/ModuleLoadRequest.cpp b/dom/script/ModuleLoadRequest.cpp index ec924ea7a4..2abc6236e8 100644 --- a/dom/script/ModuleLoadRequest.cpp +++ b/dom/script/ModuleLoadRequest.cpp @@ -148,6 +148,11 @@ ModuleLoadRequest::LoadFailed() // We failed to load the source text or an error occurred unrelated to the // content of the module (e.g. OOM). + if (IsCanceled()) { + return; + } + + MOZ_ASSERT(!IsReadyToRun()); MOZ_ASSERT(!mModuleScript); Cancel();