diff --git a/netwerk/protocol/http/nsCORSListenerProxy.cpp b/netwerk/protocol/http/nsCORSListenerProxy.cpp index 8d4cd487ba..add904092a 100644 --- a/netwerk/protocol/http/nsCORSListenerProxy.cpp +++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp @@ -556,8 +556,13 @@ nsCORSListenerProxy::CheckRequestApproved(nsIRequest* aRequest) // Check if the request failed nsresult status; nsresult rv = aRequest->GetStatus(&status); - NS_ENSURE_SUCCESS(rv, rv); - NS_ENSURE_SUCCESS(status, status); + if (NS_FAILED(rv)) { + return rv; + } + + if (NS_FAILED(status)) { + return status; + } // Test that things worked on a HTTP level nsCOMPtr http = do_QueryInterface(aRequest);