From aa665262ce52329d515c1db6c10c86608d1bbc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Wed, 2 Jan 2019 08:25:13 +0000 Subject: [PATCH] Bug 1513304 - check that the nsIURI pointer is not null - r=baku Verify that the script URI is not null before using it. If it's the case, we can't really continue because that url identifies the worker in the metrics. Differential Revision: https://phabricator.services.mozilla.com/D15187 --HG-- extra : moz-landing-system : lando --- dom/workers/WorkerDebugger.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/workers/WorkerDebugger.cpp b/dom/workers/WorkerDebugger.cpp index 46eb034d1e1a..b9925184b949 100644 --- a/dom/workers/WorkerDebugger.cpp +++ b/dom/workers/WorkerDebugger.cpp @@ -458,6 +458,11 @@ RefPtr WorkerDebugger::ReportPerformanceInfo() { // getting the worker URL RefPtr scriptURI = mWorkerPrivate->GetResolvedScriptURI(); + if (NS_WARN_IF(!scriptURI)) { + // This can happen at shutdown, let's stop here. + return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE, + __func__); + } nsCString url = scriptURI->GetSpecOrDefault(); // Workers only produce metrics for a single category -