Bug 370024 - Nullcheck mPrintingSurface in EndDocument to prevent crashing when printing

p=cbarrett@mozilla.com (Colin Barrett)
r+sr=pavlov@pavlov.net (Stuart Parmenter)
This commit is contained in:
gijskruitbosch%gmail.com 2007-02-16 10:23:00 +00:00
parent 08cc168e07
commit d94594b5d3

View File

@ -509,9 +509,10 @@ nsThebesDeviceContext::BeginDocument(PRUnichar* aTitle,
NS_IMETHODIMP
nsThebesDeviceContext::EndDocument(void)
{
mPrintingSurface->EndPrinting();
mPrintingSurface->Finish();
if (mPrintingSurface) {
mPrintingSurface->EndPrinting();
mPrintingSurface->Finish();
}
if (mDeviceContextSpec)
mDeviceContextSpec->EndDocument();
return NS_OK;