Add null ptr check to fix bug 59281. r=adamlock sr=waterson

This commit is contained in:
jband%netscape.com 2000-11-08 06:31:57 +00:00
parent 37c216df3d
commit fa23038df9

View File

@ -2855,6 +2855,10 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
nsCOMPtr<nsIWidget> widget;
NS_ENSURE_SUCCESS(GetMainWidget(getter_AddRefs(widget)), NS_ERROR_FAILURE);
if (!widget) {
NS_ERROR("GetMainWidget coughed up a null widget");
return NS_ERROR_FAILURE;
}
nsRect bounds(x, y, cx, cy);
NS_ENSURE_SUCCESS(EnsureDeviceContext(), NS_ERROR_FAILURE);