X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05a7f61d901a8abe54a563772ccf072d1d9284bf..276c7463f35b7f3ec8dfdbe80b29448f2e503d93:/src/generic/treectlg.cpp 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)