diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index edc1b0d090..f0179e06f5 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1855,7 +1855,7 @@ void wxGenericTreeCtrl::EnsureVisible(const wxTreeItemId& item) if ( HasFlag(wxTR_HIDE_ROOT) ) { - while ( parent != m_anchor ) + while ( parent && parent != m_anchor ) { Expand(parent); parent = parent->GetParent(); @@ -2815,6 +2815,7 @@ wxTreeItemId wxGenericTreeCtrl::HitTest(const wxPoint& point, int& flags) } wxGenericTreeItem *hit = m_anchor->HitTest(CalcUnscrolledPosition(point), + // wxGenericTreeItem *hit = m_anchor->HitTest(point, this, flags, 0); if (hit == NULL) {