From 77bb87e5ebba608eb2f314b086ba671557c6071d Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Fri, 14 Apr 2017 12:24:07 +0300 Subject: [PATCH] Bug 1354810, CycleCollectedJSContext::Get() needs to be null-checked, r=baku --- dom/promise/Promise.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp index 822a19db3c81..9b583e437e73 100644 --- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -570,6 +570,9 @@ Promise::PerformWorkerMicroTaskCheckpoint() MOZ_ASSERT(!NS_IsMainThread(), "Wrong thread!"); CycleCollectedJSContext* context = CycleCollectedJSContext::Get(); + if (!context) { + return; + } for (;;) { // For a normal microtask checkpoint, we try to use the debugger microtask @@ -604,6 +607,9 @@ Promise::PerformWorkerDebuggerMicroTaskCheckpoint() MOZ_ASSERT(!NS_IsMainThread(), "Wrong thread!"); CycleCollectedJSContext* context = CycleCollectedJSContext::Get(); + if (!context) { + return; + } for (;;) { // For a debugger microtask checkpoint, we always use the debugger microtask