From 0fe5d16d9c9a5190dae79826608e8fd1f331d2fb Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Mon, 31 Dec 2012 07:48:57 -0800 Subject: [PATCH] Bug 824723: Don't fire error events if the worker is shutting down. r=bent --- dom/workers/WorkerPrivate.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 725bbd85a766..9b08a4262b01 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -937,9 +937,13 @@ public: bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) { - JSObject* target = aWorkerPrivate->IsAcceptingEvents() ? - aWorkerPrivate->GetJSObject() : - nullptr; + // Don't fire this event if the JS object has been disconnected from the + // private object. + if (!aWorkerPrivate->IsAcceptingEvents()) { + return true; + } + + JSObject* target = aWorkerPrivate->GetJSObject(); uint64_t innerWindowId;