diff --git a/dom/serviceworkers/ServiceWorkerOp.cpp b/dom/serviceworkers/ServiceWorkerOp.cpp index 9f7157e396f0..c57fd7fe2a7e 100644 --- a/dom/serviceworkers/ServiceWorkerOp.cpp +++ b/dom/serviceworkers/ServiceWorkerOp.cpp @@ -303,7 +303,10 @@ class ServiceWorkerOp::ServiceWorkerOpRunnable final MOZ_ASSERT(aWorkerPrivate->IsServiceWorker()); MOZ_ASSERT(mOwner); - if (aWorkerPrivate->GlobalScope()->IsDying()) { + // GlobalScope could be nullptr here that OOM issue causes GlobalScope + // creation fail. + if (!aWorkerPrivate->GlobalScope() || + aWorkerPrivate->GlobalScope()->IsDying()) { Unused << Cancel(); return true; }