Fix crash from possible NULL pointer in wxQT list ctrl

Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mariano Reingart
2015-01-19 03:02:23 +00:00
parent 0476cf3791
commit c8e56fa2cf

View File

@@ -783,11 +783,13 @@ long wxListCtrl::HitTest(const wxPoint& point, int &flags, long* ptrSubItem) con
if ( index.isValid() ) if ( index.isValid() )
{ {
flags = wxLIST_HITTEST_ONITEM; flags = wxLIST_HITTEST_ONITEM;
if (ptrSubItem)
*ptrSubItem = index.column(); *ptrSubItem = index.column();
} }
else else
{ {
flags = wxLIST_HITTEST_NOWHERE; flags = wxLIST_HITTEST_NOWHERE;
if (ptrSubItem)
*ptrSubItem = 0; *ptrSubItem = 0;
} }
return index.row(); return index.row();