diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index de6f536e996..81e11aaacd9 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -1425,7 +1425,7 @@ nsXMLHttpRequest::OpenRequest(const nsACString& method, // Find the load group for the page, and add ourselves to it. This way any // pending requests will be automatically aborted if the user leaves the page. nsCOMPtr loadGroup; - if (!(mState & XML_HTTP_REQUEST_BACKGROUND)) { + if (doc && !(mState & XML_HTTP_REQUEST_BACKGROUND)) { loadGroup = doc->GetDocumentLoadGroup(); }