From 28387bbc2d0e0144b5fbb325e6998e9cf19aa818 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 29 May 2008 09:53:59 +0000 Subject: [PATCH] guarding against crashes because of out-of-bounds accesses in release mode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/listctrl_mac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 07bea158b5..5f13ca33a5 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -3177,7 +3177,7 @@ void wxMacDataBrowserListCtrlControl::MacSetColumnInfo( unsigned int row, unsign { wxMacDataItem* dataItem = GetItemFromLine(row); wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") ); - if (item) + if (dataItem && item) { wxMacListCtrlItem* listItem = wx_static_cast(wxMacListCtrlItem*,dataItem); bool hasInfo = listItem->HasColumnInfo( column ); @@ -3220,7 +3220,7 @@ void wxMacDataBrowserListCtrlControl::MacGetColumnInfo( unsigned int row, unsign wxMacDataItem* dataItem = GetItemFromLine(row); wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem in MacGetColumnInfo. Is row a valid wxListCtrl row?") ); // CS should this guard against dataItem = 0 ? , as item is not a pointer if (item) is not appropriate - //if (item) + if (dataItem) { wxMacListCtrlItem* listItem =wx_static_cast(wxMacListCtrlItem*,dataItem);