From 16b9bbc8abdc3e8f41d2b5f86d4ad66291265bec Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Fri, 17 Apr 2026 00:53:21 +0200 Subject: [PATCH] no-bug: Make checks on new BC --- src/zen/boosts/nsZenBoostsBackend.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zen/boosts/nsZenBoostsBackend.cpp b/src/zen/boosts/nsZenBoostsBackend.cpp index d9899b180..e48828320 100644 --- a/src/zen/boosts/nsZenBoostsBackend.cpp +++ b/src/zen/boosts/nsZenBoostsBackend.cpp @@ -287,8 +287,13 @@ auto nsZenBoostsBackend::onPresShellEntered(mozilla::dom::Document* aDocument) // Note that aDocument can be null when entering anonymous content frames. // We explicitly do this to prevent applying boosts to anonymous content, such // as devtools or screenshots. + mozilla::dom::BrowsingContext* browsingContext = mCurrentBrowsingContext = aDocument ? aDocument->GetBrowsingContext() : nullptr; + if (!browsingContext) { + return; + } + mCurrentBrowsingContext = browsingContext; } [[nodiscard]] ZEN_HOT_FUNCTION auto