check for NULL pointer in OnMeasureItem() as well as in OnDrawItem()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-04-23 12:29:44 +00:00
parent 31a38a342e
commit 29215a7105

View File

@@ -3607,7 +3607,11 @@ wxWindowMSW::MSWOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
{
wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
wxCHECK_MSG( pMenuItem && pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)),
// see comment before the same test in MSWOnMeasureItem() below
if ( !pMenuItem )
return false;
wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem),
false, _T("MSWOnDrawItem: bad wxMenuItem pointer") );
// prepare to call OnDrawItem(): notice using of wxDCTemp to prevent