From 38c2faa2bbd79fa2016c61fcb3944bfbced3a4a2 Mon Sep 17 00:00:00 2001 From: "sharparrow1@yahoo.com" Date: Thu, 20 Apr 2006 04:08:18 +0000 Subject: [PATCH] Bug 332746: null check to prevent crash printing select controls. r+sr=roc --- view/src/nsView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index b3efa98d7949..8de933f8d6ef 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -660,6 +660,10 @@ nsresult nsIView::CreateWidget(const nsIID &aWindowIID, : nsnull; trect += offset; if (aWidgetInitData->mWindowType == eWindowType_popup) { + // Without a parent, we can't make a popup. This can happen + // when printing + if (!parentWidget) + return NS_ERROR_FAILURE; mWindow->Create(parentWidget->GetNativeData(NS_NATIVE_WIDGET), trect, ::HandleEvent, dx, nsnull, nsnull, aWidgetInitData); } else {