Bug 489045 - nsXULWindow::GetParentNativeWindow crashes if GetParentWidget returns null. r=roc

This commit is contained in:
Markus Stange 2009-10-09 20:05:08 +13:00
parent 1db2aff813
commit 635704a6bc

View File

@ -742,8 +742,10 @@ NS_IMETHODIMP nsXULWindow::GetParentNativeWindow(nativeWindow* aParentNativeWind
nsCOMPtr<nsIWidget> parentWidget;
NS_ENSURE_SUCCESS(GetParentWidget(getter_AddRefs(parentWidget)), NS_ERROR_FAILURE);
*aParentNativeWindow = parentWidget->GetNativeData(NS_NATIVE_WIDGET);
if (parentWidget) {
*aParentNativeWindow = parentWidget->GetNativeData(NS_NATIVE_WIDGET);
}
return NS_OK;
}