]> git.saurik.com Git - wxWidgets.git/commitdiff
item with no image no longer crash when hit
authorSylvain Bougnoux <bougnoux@imra-europe.com>
Mon, 19 Jul 1999 17:05:47 +0000 (17:05 +0000)
committerSylvain Bougnoux <bougnoux@imra-europe.com>
Mon, 19 Jul 1999 17:05:47 +0000 (17:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectrl.cpp

index d8ee1f164169ed4c4d44a962347f06f6958aa879..eeb663680fd3cfa6f73077a1b3810afd0df8755d 100644 (file)
@@ -317,8 +317,9 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point,
       int image_h;
 
       // assuming every image (normal and selected ) has the same size !
-      if (theTree->m_imageListNormal)
+      if ((m_image!=-1) && theTree->m_imageListNormal)
           theTree->m_imageListNormal->GetSize(m_image, image_w, image_h);
+
       if ((image_w != -1) && (point.x <= m_x + image_w + 1))
        flags|=wxTREE_HITTEST_ONITEMICON;
       else