From c81474e267d5052464fd85a4f12247f5189f416c Mon Sep 17 00:00:00 2001 From: "dcone%netscape.com" Date: Mon, 24 May 1999 20:44:53 +0000 Subject: [PATCH] Fixed a printing crashing bug in Update(), Now check to make sure mWindowPtr is not null. --- widget/src/mac/nsWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/widget/src/mac/nsWindow.cpp b/widget/src/mac/nsWindow.cpp index 422259851c3a..95b12c6d2235 100644 --- a/widget/src/mac/nsWindow.cpp +++ b/widget/src/mac/nsWindow.cpp @@ -760,7 +760,7 @@ PRBool nsWindow::OnPaint(nsPaintEvent &event) //------------------------------------------------------------------------- NS_IMETHODIMP nsWindow::Update() { - if (! mVisible) + if (! mVisible || !mWindowPtr) return NS_OK; static PRBool reentrant = PR_FALSE; @@ -778,7 +778,8 @@ NS_IMETHODIMP nsWindow::Update() #if TARGET_CARBON ::GetWindowRegion(mWindowPtr, kWindowUpdateRgn, saveUpdateRgn); #else - ::CopyRgn(((WindowRecord*)mWindowPtr)->updateRgn, saveUpdateRgn); + if(mWindowPtr) + ::CopyRgn(((WindowRecord*)mWindowPtr)->updateRgn, saveUpdateRgn); #endif // draw the widget