From 31d2695f81dc1b967ed14424652c94c84b48d369 Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Thu, 8 Sep 2022 03:29:36 +0000 Subject: [PATCH] Bug 1786818. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D155462 --- dom/base/nsDOMWindowUtils.cpp | 2 +- image/SVGDocumentWrapper.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index e3f0cb18cf74..2396139df4c7 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -2803,7 +2803,7 @@ nsDOMWindowUtils::AdvanceTimeAndRefresh(int64_t aMilliseconds) { nsPresContext* presContext = GetPresContext(); if (presContext) { - nsRefreshDriver* driver = presContext->RefreshDriver(); + RefPtr driver = presContext->RefreshDriver(); driver->AdvanceTimeAndRefresh(aMilliseconds); if (WebRenderBridgeChild* wrbc = GetWebRenderBridge()) { diff --git a/image/SVGDocumentWrapper.cpp b/image/SVGDocumentWrapper.cpp index a85176db49e1..2c081afb9ec5 100644 --- a/image/SVGDocumentWrapper.cpp +++ b/image/SVGDocumentWrapper.cpp @@ -180,7 +180,9 @@ void SVGDocumentWrapper::SetCurrentTime(float aTime) { void SVGDocumentWrapper::TickRefreshDriver() { if (RefPtr presShell = mViewer->GetPresShell()) { if (RefPtr presContext = presShell->GetPresContext()) { - presContext->RefreshDriver()->DoTick(); + if (RefPtr driver = presContext->RefreshDriver()) { + driver->DoTick(); + } } } }