diff --git a/toolkit/components/antitracking/ContentBlocking.cpp b/toolkit/components/antitracking/ContentBlocking.cpp index f5d024f7c6be..224a0a0c7217 100644 --- a/toolkit/components/antitracking/ContentBlocking.cpp +++ b/toolkit/components/antitracking/ContentBlocking.cpp @@ -322,6 +322,10 @@ ContentBlocking::AllowAccessFor( bool isThirdParty; nsCOMPtr principal = AntiTrackingUtils::GetPrincipal(aParentContext); + if (!principal) { + LOG(("Can't get the principal from the browsing context")); + return StorageAccessGrantPromise::CreateAndReject(false, __func__); + } Unused << trackingPrincipal->IsThirdPartyPrincipal(principal, &isThirdParty); runInSameProcess = !isThirdParty;