From c3c979c7b8b40876cce4beb8d84190c41cfd2c43 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 21 Dec 2000 16:12:43 +0000 Subject: [PATCH] Modified treectrlg.cpp not to crash in HitTest if there's no m_anchor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index cb0a92a615..6a24217b12 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2218,7 +2218,10 @@ wxTreeItemId wxGenericTreeCtrl::HitTest(const wxPoint& point, int& flags) if (point.y<0) flags|=wxTREE_HITTEST_ABOVE; if (point.y>h) flags|=wxTREE_HITTEST_BELOW; - return m_anchor->HitTest( wxPoint(x, y), this, flags); + if (m_anchor) + return m_anchor->HitTest( wxPoint(x, y), this, flags); + else + return wxTreeItemId(); } // get the bounding rectangle of the item (or of its label only) -- 2.50.0