diff --git a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp index 7fea106b35be..7a32605ed641 100644 --- a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp @@ -197,6 +197,8 @@ NS_IMETHODIMP nsSVGForeignObjectFrame::PaintSVG(nsSVGRenderState *aContext, const nsIntRect *aDirtyRect) { + NS_ABORT_IF_FALSE(aDirtyRect, "We expect aDirtyRect to be non-null"); + if (IsDisabled()) return NS_OK; @@ -215,11 +217,9 @@ nsSVGForeignObjectFrame::PaintSVG(nsSVGRenderState *aContext, } /* Check if we need to draw anything. */ - if (aDirtyRect) { - PRInt32 appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel(); - if (!mRect.ToOutsidePixels(appUnitsPerDevPx).Intersects(*aDirtyRect)) - return NS_OK; - } + PRInt32 appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel(); + if (!mRect.ToOutsidePixels(appUnitsPerDevPx).Intersects(*aDirtyRect)) + return NS_OK; gfxContext *gfx = aContext->GetGfxContext();