diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 6fc526fac7..f113a10f7e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3601,11 +3601,7 @@ wxWindowMSW::MSWOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id), { wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData); - // see comment before the same test in MSWOnMeasureItem() below - if ( !pMenuItem ) - return false; - - wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem), + wxCHECK_MSG( pMenuItem && pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), false, _T("MSWOnDrawItem: bad wxMenuItem pointer") ); // prepare to call OnDrawItem(): notice using of wxDCTemp to prevent