Adding a nsnull check before we call through a returned pointer. Breaking on linux

git-svn-id: svn://10.0.0.236/trunk@18751 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
saari%netscape.com 1999-01-27 06:01:38 +00:00
parent 3e91c0d918
commit dac2b29609

View File

@ -284,13 +284,15 @@ nsWebShellWindow::UpdateButtonStatus(PRBool aIsBusy)
} else {
nsIWebShell* contentWS = nsnull;
mWebShell->FindChildWithName(nsAutoString("browser.webwindow"), contentWS);
SetCommandEnabled(nsAutoString("nsCmd:BrowserBack"), contentWS->CanBack() == NS_OK);
SetCommandEnabled(nsAutoString("nsCmd:BrowserForward"), contentWS->CanForward() == NS_OK);
SetCommandEnabled(nsAutoString("nsCmd:BrowserReload"), PR_TRUE);
SetCommandEnabled(nsAutoString("nsCmd:BrowserStop"), PR_FALSE);
SetCommandEnabled(nsAutoString("nsCmd:BrowserHome"), PR_TRUE);
SetCommandEnabled(nsAutoString("nsCmd:BrowserPrint"), PR_TRUE);
NS_RELEASE(contentWS);
if(nsnull != contentWS){
SetCommandEnabled(nsAutoString("nsCmd:BrowserBack"), contentWS->CanBack() == NS_OK);
SetCommandEnabled(nsAutoString("nsCmd:BrowserForward"), contentWS->CanForward() == NS_OK);
SetCommandEnabled(nsAutoString("nsCmd:BrowserReload"), PR_TRUE);
SetCommandEnabled(nsAutoString("nsCmd:BrowserStop"), PR_FALSE);
SetCommandEnabled(nsAutoString("nsCmd:BrowserHome"), PR_TRUE);
SetCommandEnabled(nsAutoString("nsCmd:BrowserPrint"), PR_TRUE);
NS_RELEASE(contentWS);
}
}
}