don't crash in UnselectAll() if the tree has no root
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1477,7 +1477,13 @@ void wxGenericTreeCtrl::UnselectAllChildren(wxGenericTreeItem *item)
|
|||||||
|
|
||||||
void wxGenericTreeCtrl::UnselectAll()
|
void wxGenericTreeCtrl::UnselectAll()
|
||||||
{
|
{
|
||||||
UnselectAllChildren((wxGenericTreeItem*) GetRootItem().m_pItem);
|
wxTreeItemId rootItem = GetRootItem();
|
||||||
|
|
||||||
|
// the tree might not have the root item at all
|
||||||
|
if ( rootItem )
|
||||||
|
{
|
||||||
|
UnselectAllChildren((wxGenericTreeItem*) rootItem.m_pItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursive function !
|
// Recursive function !
|
||||||
|
Reference in New Issue
Block a user