]> git.saurik.com Git - wxWidgets.git/commitdiff
Modified treectrlg.cpp not to crash in HitTest if there's no m_anchor
authorJulian Smart <julian@anthemion.co.uk>
Thu, 21 Dec 2000 16:12:43 +0000 (16:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 21 Dec 2000 16:12:43 +0000 (16:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index cb0a92a6153782da785d1bbe3dba0dbc5ca80df2..6a24217b124c2839cf7b5966647188d9c70de350 100644 (file)
@@ -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)