adding checks for null mContext member in a couple of places - fixes bug #2200

git-svn-id: svn://10.0.0.236/trunk@17985 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jfrancis%netscape.com 1999-01-19 02:05:53 +00:00
parent 10747a8399
commit cb60c36d89

View File

@ -488,8 +488,9 @@ void nsRenderingContextMac::SelectDrawingSurface(DrawingSurface* aSurface)
if (mGS->mFontMetrics)
SetFont(mGS->mFontMetrics);
if (!mContext) return;
// GS and context initializations
((nsDeviceContextMac *)mContext)->SetDrawingSurface(mPort);
#if 0
@ -521,6 +522,11 @@ NS_IMETHODIMP nsRenderingContextMac::SetPortTextState()
if (nsnull == mGS->mFontMetrics)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION(mContext != nsnull, "No device context in SetPortTextState");
if (nsnull == mContext)
return NS_ERROR_NULL_POINTER;
TextStyle theStyle;
nsFontMetricsMac::GetNativeTextStyle(*mGS->mFontMetrics, *mContext, theStyle);