diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 7f69dfca397..9389dba056c 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -308,10 +308,13 @@ MaybeReflowForInflationScreenWidthChange(nsPresContext *aPresContext) nsCOMPtr shell; nsCOMPtr cv = do_QueryInterface(array[i]); cv->GetPresShell(getter_AddRefs(shell)); - nsIFrame *rootFrame = shell->GetRootFrame(); - if (rootFrame) { - shell->FrameNeedsReflow(rootFrame, nsIPresShell::eResize, - NS_FRAME_IS_DIRTY); + nsFrameManager *fm = shell->FrameManager(); + if (fm) { + nsIFrame *rootFrame = fm->GetRootFrame(); + if (rootFrame) { + shell->FrameNeedsReflow(rootFrame, nsIPresShell::eResize, + NS_FRAME_IS_DIRTY); + } } } }