From: Julian Smart Date: Thu, 21 Dec 2000 16:12:43 +0000 (+0000) Subject: Modified treectrlg.cpp not to crash in HitTest if there's no m_anchor X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c3c979c7b8b40876cce4beb8d84190c41cfd2c43?ds=sidebyside 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 --- 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)