Bug 1539208 - P1 - Return an error when the Reponse object is null'd; r=mayhemer
authorTom Tung <shes050117@gmail.com>
Thu, 28 Mar 2019 15:27:49 +0000
changeset 466730 cec67adbdbb6d5b2948a68e4f6fb13612f949368
parent 466729 116b9cd070f29167d65c90ceb1ac4e7ac60f9db9
child 466731 7b17d77256be8a810d75865b422a49b4adca7a90
push id35780
push useropoprus@mozilla.com
push dateFri, 29 Mar 2019 21:53:01 +0000
treeherdermozilla-central@414f37afbe07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1539208
milestone68.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 1539208 - P1 - Return an error when the Reponse object is null'd; r=mayhemer Differential Revision: https://phabricator.services.mozilla.com/D25228
dom/fetch/FetchDriver.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -1043,17 +1043,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();
     }