safety checks for null pointers

Bug 172783 r=dcone sr=kin
This commit is contained in:
rods@netscape.com
2002-10-08 10:46:27 +00:00
parent 42f9eb8e2c
commit c9c3612044
4 changed files with 26 additions and 12 deletions

View File

@@ -291,10 +291,13 @@ nsPrintingPromptService::DoDialog(nsIDOMWindow *aParent,
NS_IMETHODIMP
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStateFlags & STATE_STOP) {
if ((aStateFlags & STATE_STOP) && mWebProgressListener) {
mWebProgressListener->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
mPrintProgress->CloseProgressDialog(PR_TRUE);
mPrintProgress = nsnull;
if (mPrintProgress) {
mPrintProgress->CloseProgressDialog(PR_TRUE);
}
mPrintProgress = nsnull;
mWebProgressListener = nsnull;
}
return NS_OK;
}