Bug 1491533 - Null check CompartmentPrivate in SetCompartmentChangedDocumentDomain. r=bholley

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan de Mooij 2018-09-17 17:13:05 +00:00
Родитель 500a400737
Коммит 50690041b2
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -599,9 +599,13 @@ CompartmentOriginInfo::IsSameOrigin(nsIPrincipal* aOther) const
void
SetCompartmentChangedDocumentDomain(JS::Compartment* compartment)
{
CompartmentPrivate* priv = CompartmentPrivate::Get(compartment);
MOZ_ASSERT(priv);
priv->originInfo.SetChangedDocumentDomain();
// Note: we call this for all compartments that contain realms with a
// particular principal. Not all of these compartments have a
// CompartmentPrivate (for instance the temporary compartment/realm
// created by the JS engine for off-thread parsing).
if (CompartmentPrivate* priv = CompartmentPrivate::Get(compartment)) {
priv->originInfo.SetChangedDocumentDomain();
}
}
JSObject*