X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9766efc33f1dc1d9a9e03ea6eb37985f20b1dd06..0cdd04ad993f86710bc5c9d9c8c12ec25a34ac71:/src/common/treebase.cpp 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