avoid assert in DoGetBestSize() for an empty tree

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-11-27 16:36:09 +00:00
parent b9643cd619
commit 16f32ee765

View File

@@ -162,7 +162,9 @@ wxSize wxTreeCtrlBase::DoGetBestSize() const
else // use precise, if potentially slow, size computation method
{
// iterate over all items recursively
wxGetBestTreeSize(this, GetRootItem(), size);
wxTreeItemId idRoot = GetRootItem();
if ( idRoot.IsOk() )
wxGetBestTreeSize(this, idRoot, size);
}
// need some minimal size even for empty tree