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
This commit is contained in:
Tarek Ziadé 2019-01-02 08:25:13 +00:00
Родитель 5dc04f9f8d
Коммит aa665262ce
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -458,6 +458,11 @@ RefPtr<PerformanceInfoPromise> WorkerDebugger::ReportPerformanceInfo() {
// getting the worker URL
RefPtr<nsIURI> 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 -