Bug 1568655. Handle null return value from nsGlobalWindowInner::GetScriptableTop in ImageCacheKey::GetTopLevelBaseDomain. r=aosmond

Every other call to this function in the tree null checks the return value.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Timothy Nikkel 2019-07-25 14:34:06 +00:00
Родитель ffc17053bb
Коммит ffe1230491
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -194,7 +194,7 @@ nsCString ImageCacheKey::GetTopLevelBaseDomain(Document* aDocument,
if (!AntiTrackingCommon::MaybeIsFirstPartyStorageAccessGrantedFor(
aDocument->GetInnerWindow(), aURI)) {
nsPIDOMWindowOuter* top = aDocument->GetInnerWindow()->GetScriptableTop();
nsPIDOMWindowInner* topInner = top->GetCurrentInnerWindow();
nsPIDOMWindowInner* topInner = top ? top->GetCurrentInnerWindow() : nullptr;
if (!topInner) {
return aDocument
->GetBaseDomain(); // because we don't have anything better!