Bug 1084513 - Add a null check on callingDoc before we try and get its principal. r=smaug

This commit is contained in:
Tanvi Vyas 2014-10-20 12:43:41 -07:00
parent a936a6e6bd
commit fe0b72ee7a

View File

@ -305,7 +305,7 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv)
nsCOMPtr<nsIPrincipal> principal = NodePrincipal();
// The callingDoc's Principal and doc's Principal should be the same
if (callingDoc->NodePrincipal() != principal) {
if (callingDoc && (callingDoc->NodePrincipal() != principal)) {
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
NS_LITERAL_CSTRING("DOM"),
callingDoc,