Bug 1626332 - null-check the canvas frame as it can be null in some documents.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2020-04-03 11:54:07 +00:00
parent bb413bca06
commit e5e8a82f19

View File

@ -510,10 +510,11 @@ static void InvalidateImages(nsIFrame* aFrame, imgIRequest* aRequest,
}
if (aFrame->IsPrimaryFrameOfRootOrBodyElement()) {
// Try to invalidate the canvas too, in the probable case the background
// was propagated to it.
InvalidateImages(aFrame->PresShell()->GetCanvasFrame(), aRequest,
aForcePaint);
if (auto* canvas = aFrame->PresShell()->GetCanvasFrame()) {
// Try to invalidate the canvas too, in the probable case the background
// was propagated to it.
InvalidateImages(canvas, aRequest, aForcePaint);
}
}
bool invalidateFrame = aForcePaint;