Bug 1587604 - Check if loadingPrincipal is null before doing cross-origin check r=mayhemer

Differential Revision: https://phabricator.services.mozilla.com/D48821

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2019-10-10 11:20:03 +00:00
parent ab9ca2b438
commit f167db7f11

View File

@ -8107,6 +8107,11 @@ void nsHttpChannel::ReportContentTypeTelemetryForCrossOriginStylesheets() {
return;
}
if (!mLoadInfo->LoadingPrincipal()) {
// No loading principal to check if it's same-origin
return;
}
nsCOMPtr<nsIURI> docURI = mLoadInfo->LoadingPrincipal()->GetURI();
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
bool isPrivateWin = mLoadInfo->GetOriginAttributes().mPrivateBrowsingId > 0;