Fixed a printing crashing bug in Update(),

Now check to make sure mWindowPtr is not null.


git-svn-id: svn://10.0.0.236/trunk@32531 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dcone%netscape.com 1999-05-24 20:44:53 +00:00
parent eb1f2f4ddc
commit d70cff6cc5

View File

@ -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