ported from esr91: Bug 1761026 - Add a null check for FetchDriver::mResponse, r=necko-reviewers,dragana a=dmeehan (3b54d6b5)

This commit is contained in:
roytam1 2022-04-11 23:50:02 +08:00
commit 30e8509fd2

View file

@ -721,10 +721,14 @@ FetchDriver::OnDataAvailable(nsIRequest* aRequest,
}
}
if (!mResponse) {
MOZ_ASSERT(false);
return NS_ERROR_UNEXPECTED;
}
// Explicitly initialized to 0 because in some cases nsStringInputStream may
// not write to aRead.
uint32_t aRead = 0;
MOZ_ASSERT(mResponse);
MOZ_ASSERT(mPipeOutputStream);
// From "Main Fetch" step 17: SRI-part2.