Bug 1367581 - don't bail out if the channel doesn't have loadInfo. r=valentin

This commit is contained in:
Yoshi Huang 2017-05-26 16:20:26 +08:00
parent e4fdd55498
commit cefd88cc40

View File

@ -1585,12 +1585,11 @@ NS_GetOriginAttributes(nsIChannel *aChannel,
mozilla::OriginAttributes &aAttributes)
{
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
if (!loadInfo) {
return false;
// For some channels, they might not have loadInfo, like ExternalHelperAppParent..
if (loadInfo) {
loadInfo->GetOriginAttributes(&aAttributes);
}
loadInfo->GetOriginAttributes(&aAttributes);
bool isPrivate = false;
nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(aChannel);
if (pbChannel) {