From 16f32ee7652c15bdbe46a85cdc0ecf036bd4003e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 27 Nov 2006 16:36:09 +0000 Subject: [PATCH] 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 --- src/common/treebase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp index 38d242bf06..08220fa503 100644 --- a/src/common/treebase.cpp +++ b/src/common/treebase.cpp @@ -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 -- 2.50.0