Bug 1412190 - Allow active context to be null during profiling (r=jandem)

MozReview-Commit-ID: 3bLcXBPpxtY
This commit is contained in:
Bill McCloskey 2017-09-22 10:56:08 -07:00
parent 51c04f774f
commit 5d1bba8be6

View File

@ -441,7 +441,7 @@ ProfileEntry::script() const
// AutoSuppressProfilerSampling prohibits the runtime's active context from
// being changed while it exists.
JSContext* cx = script->runtimeFromAnyThread()->activeContext();
if (!cx->isProfilerSamplingEnabled())
if (!cx || !cx->isProfilerSamplingEnabled())
return nullptr;
MOZ_ASSERT(!IsForwarded(script));