From 0b33172e2b150da17f23158c9f95b5b31b5add08 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Mon, 19 Jul 1999 19:57:30 +0000 Subject: [PATCH] hail mary bulletproofing fix for #10035 --- view/src/nsView.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index bcbe1ebb806b..84c04ebca748 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -76,6 +76,7 @@ nsView :: nsView() mXForm = nsnull; mVFlags = 0; mOpacity = 1.0f; + mViewManager = nsnull; } nsView :: ~nsView() @@ -955,7 +956,13 @@ NS_IMETHODIMP nsView :: SetBounds(nscoord aX, nscoord aY, nscoord aWidth, nscoor NS_IMETHODIMP nsView :: GetBounds(nsRect &aBounds) const { - nsIView *rootView; + nsIView *rootView = nsnull; + + NS_ASSERTION(mViewManager, "mViewManager is null!"); + if (!mViewManager) { + aBounds.x = aBounds.y = 0; + return NS_ERROR_FAILURE; + } mViewManager->GetRootView(rootView); aBounds = mBounds;