Bug 1802386: If we can't find a PresContext or the root PresContext, bail out of WillRefresh r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D164270
This commit is contained in:
Morgan Rae Reschenberg 2022-12-14 18:26:19 +00:00
parent a93e3a2add
commit 9bb1925772

View File

@ -628,10 +628,13 @@ void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
}
// Wait until an update, we have started, or an interruptible reflow is
// finished.
// finished. We also check the existance of our pres context and root pres
// context, since if we can't reach either of these the frame tree is being
// destroyed.
nsPresContext* pc = mPresShell->GetPresContext();
if (mObservingState == eRefreshProcessing ||
mObservingState == eRefreshProcessingForUpdate ||
mPresShell->IsReflowInterrupted()) {
mPresShell->IsReflowInterrupted() || !pc || !pc->GetRootPresContext()) {
return;
}