Bug 1539208 - P1 - Return an error when the Reponse object is null'd a=pascalc
authorshindli <shindli@mozilla.com>
Mon, 01 Apr 2019 17:35:46 +0300
changeset 525967 6168e6cc5761ddbf95cc5b7466a339c432a1ba07
parent 525966 78f43d6cbd56ffeff48ddeefb73f0ce7bf2010da
child 525968 4b57a43c92b979133a21fd1a3b27989e9c048119
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspascalc
bugs1539208
milestone67.0
Bug 1539208 - P1 - Return an error when the Reponse object is null'd a=pascalc Reviewers: mayhemer, baku Reviewed By: mayhemer Bug #: 1539208 Differential Revision: https://phabricator.services.mozilla.com/D25228
dom/fetch/FetchDriver.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -1044,17 +1044,17 @@ FetchDriver::OnStartRequest(nsIRequest* 
 
   // Resolves fetch() promise which may trigger code running in a worker.  Make
   // sure the Response is fully initialized before calling this.
   mResponse = BeginAndGetFilteredResponse(response, foundOpaqueRedirect);
   if (NS_WARN_IF(!mResponse)) {
     // Fail to generate a paddingInfo for opaque response.
     MOZ_DIAGNOSTIC_ASSERT(mResponse->Type() == ResponseType::Opaque);
     FailWithNetworkError(NS_ERROR_UNEXPECTED);
-    return rv;
+    return NS_ERROR_UNEXPECTED;
   }
 
   // From "Main Fetch" step 19: SRI-part1.
   if (ShouldCheckSRI(mRequest, mResponse) && mSRIMetadata.IsEmpty()) {
     nsIConsoleReportCollector* reporter = nullptr;
     if (mObserver) {
       reporter = mObserver->GetReporter();
     }