Bug 1757188 - Ensure workerPrivate is not null, r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D139713
This commit is contained in:
Jason Kratzer
2022-03-14 14:28:55 +00:00
parent e4c8adc1ad
commit 2778a22f4c

View File

@@ -1985,7 +1985,11 @@ already_AddRefed<EventSource> EventSource::Constructor(
} else {
// Worker side.
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
MOZ_ASSERT(workerPrivate);
if (!workerPrivate) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
cookieJarSettings = workerPrivate->CookieJarSettings();
}