diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 13a6a5efc18..9490a11a25e 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -2899,11 +2899,13 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, nsRect viewportArea; // get the nsIScrollableFrame interface from the scrollFrame - nsIFrame* scrollFrame = GetNearestScrollFrame(aForFrame); nsIScrollableFrame* scrollableFrame; - CallQueryInterface(scrollFrame, &scrollableFrame); - if (scrollableFrame) { - scrollableFrame->GetScrolledFrame(aPresContext, scrolledFrame); + nsIFrame* scrollFrame = GetNearestScrollFrame(aForFrame); + if (scrollFrame) { + CallQueryInterface(scrollFrame, &scrollableFrame); + if (scrollableFrame) { + scrollableFrame->GetScrolledFrame(aPresContext, scrolledFrame); + } } if (scrolledFrame) { diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 13a6a5efc18..9490a11a25e 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -2899,11 +2899,13 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, nsRect viewportArea; // get the nsIScrollableFrame interface from the scrollFrame - nsIFrame* scrollFrame = GetNearestScrollFrame(aForFrame); nsIScrollableFrame* scrollableFrame; - CallQueryInterface(scrollFrame, &scrollableFrame); - if (scrollableFrame) { - scrollableFrame->GetScrolledFrame(aPresContext, scrolledFrame); + nsIFrame* scrollFrame = GetNearestScrollFrame(aForFrame); + if (scrollFrame) { + CallQueryInterface(scrollFrame, &scrollableFrame); + if (scrollableFrame) { + scrollableFrame->GetScrolledFrame(aPresContext, scrolledFrame); + } } if (scrolledFrame) {