diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index b53722f7beb..b4a473cff8e 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -915,7 +915,12 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource, NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr uploadChannel(do_QueryInterface(reportChannel)); - NS_ASSERTION(uploadChannel, "nsIUploadChannel is needed but not available to send CSP violation reports"); + if (!uploadChannel) { + // It's possible the URI provided can't be uploaded to, in which case + // we skip this one. We'll already have warned about a non-HTTP URI earlier. + continue; + } + rv = uploadChannel->SetUploadStream(sis, NS_LITERAL_CSTRING("application/json"), -1); NS_ENSURE_SUCCESS(rv, rv);