From 773c19b934729eeab22bb02982194d2ee6dba8e6 Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Thu, 14 Feb 2002 00:15:40 +0000 Subject: [PATCH] Prevent crash by checking for null frameManager before deref. in UnsuppressAndInvalidate. r=alexsavulov sr=hyatt b=121822 git-svn-id: svn://10.0.0.236/trunk@114451 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 19 +++++++++++-------- mozilla/layout/html/base/src/nsPresShell.cpp | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 74cda16ae40..cc8bf850fa1 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -4762,14 +4762,17 @@ PresShell::UnsuppressAndInvalidate() } } - mPaintingSuppressed = PR_FALSE; - nsIFrame* rootFrame; - mFrameManager->GetRootFrame(&rootFrame); - if (rootFrame) { - nsRect rect; - rootFrame->GetRect(rect); - if (!rect.IsEmpty()) { - ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + NS_ASSERTION(mFrameManager, "frameManager is already gone"); + if (mFrameManager) { + mPaintingSuppressed = PR_FALSE; + nsIFrame* rootFrame; + mFrameManager->GetRootFrame(&rootFrame); + if (rootFrame) { + nsRect rect; + rootFrame->GetRect(rect); + if (!rect.IsEmpty()) { + ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + } } } diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 74cda16ae40..cc8bf850fa1 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -4762,14 +4762,17 @@ PresShell::UnsuppressAndInvalidate() } } - mPaintingSuppressed = PR_FALSE; - nsIFrame* rootFrame; - mFrameManager->GetRootFrame(&rootFrame); - if (rootFrame) { - nsRect rect; - rootFrame->GetRect(rect); - if (!rect.IsEmpty()) { - ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + NS_ASSERTION(mFrameManager, "frameManager is already gone"); + if (mFrameManager) { + mPaintingSuppressed = PR_FALSE; + nsIFrame* rootFrame; + mFrameManager->GetRootFrame(&rootFrame); + if (rootFrame) { + nsRect rect; + rootFrame->GetRect(rect); + if (!rect.IsEmpty()) { + ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + } } }