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 NS_IMETHODIMP
nsThebesDeviceContext::EndDocument(void) nsThebesDeviceContext::EndDocument(void)
{ {
mPrintingSurface->EndPrinting(); if (mPrintingSurface) {
mPrintingSurface->Finish(); mPrintingSurface->EndPrinting();
mPrintingSurface->Finish();
}
if (mDeviceContextSpec) if (mDeviceContextSpec)
mDeviceContextSpec->EndDocument(); mDeviceContextSpec->EndDocument();
return NS_OK; return NS_OK;