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

git-svn-id: svn://10.0.0.236/trunk@82422 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jband%netscape.com
2000-11-08 06:31:57 +00:00
parent 29720c9727
commit 9dc5349161

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);