Bug 1513304 - check that the nsIURI pointer is not null - r=baku
authorTarek Ziadé <tarek@mozilla.com>
Wed, 02 Jan 2019 08:25:13 +0000
changeset 509379 af611c004da28dff5376cc13cfc02a42114ce9a3
parent 509378 28694796fe295def9d09e3f1555c952248b5d158
child 509380 30ef2bb56b9d38da608866b58df2930cb58c2caf
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1513304
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/workers/WorkerDebugger.cpp
--- a/dom/workers/WorkerDebugger.cpp
+++ b/dom/workers/WorkerDebugger.cpp
@@ -453,16 +453,21 @@ RefPtr<PerformanceInfoPromise> WorkerDeb
         windowID = top->WindowID();
         isTopLevel = outer->IsTopLevelWindow();
       }
     }
   }
 
   // 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 -
   // DispatchCategory::Worker. We still return an array of CategoryDispatch so
   // the PerformanceInfo struct is common to all performance counters throughout
   // Firefox.
   FallibleTArray<CategoryDispatch> items;
   uint64_t duration = 0;