Bug 1540903 - Instead of assuming success, do proper error checking; r=asuth a=lizzard
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 25 Oct 2019 02:55:26 +0000
changeset 555670 dbeffc0408158c980245d1be7dd5440af1e99377
parent 555669 588266ed71ed5b9996030eaa2e9aba1daafd3b44
child 555671 7f54c395aff874acc7e78cb79c215b159f8f9c46
push id2179
push userbtara@mozilla.com
push dateTue, 29 Oct 2019 23:10:30 +0000
treeherdermozilla-release@dbeffc040815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, lizzard
bugs1540903
milestone70.0.1
Bug 1540903 - Instead of assuming success, do proper error checking; r=asuth a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D50553
dom/indexedDB/ScriptErrorHelper.cpp
--- a/dom/indexedDB/ScriptErrorHelper.cpp
+++ b/dom/indexedDB/ScriptErrorHelper.cpp
@@ -94,17 +94,21 @@ class ScriptErrorRunnable final : public
     category.AppendLiteral("javascript");
 
     nsCOMPtr<nsIConsoleService> consoleService =
         do_GetService(NS_CONSOLESERVICE_CONTRACTID);
     MOZ_ASSERT(consoleService);
 
     nsCOMPtr<nsIScriptError> scriptError =
         do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
-    MOZ_ASSERT(scriptError);
+    // We may not be able to create the script error object when we're shutting
+    // down.
+    if (!scriptError) {
+      return;
+    }
 
     if (aInnerWindowID) {
       MOZ_ALWAYS_SUCCEEDS(scriptError->InitWithWindowID(
           aMessage, aFilename,
           /* aSourceLine */ EmptyString(), aLineNumber, aColumnNumber,
           aSeverityFlag, category, aInnerWindowID));
     } else {
       MOZ_ALWAYS_SUCCEEDS(scriptError->Init(