diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index c1e28388c9..61f5f79049 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1995,7 +1995,7 @@ wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const m_dbImpl->GetItemID( (DataBrowserTableViewRowIndex) row, &id ); // TODO: Use GetDataBrowserItemPartBounds to return if we are in icon or label - if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) ) + if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) && row < GetItemCount() ) { wxMacListCtrlItem* lcItem; lcItem = (wxMacListCtrlItem*) id;