]> git.saurik.com Git - wxWidgets.git/commitdiff
silently ignore NULL pointers in MSWOnMeasureItem(): apparently this can happen with...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Apr 2005 22:13:33 +0000 (22:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Apr 2005 22:13:33 +0000 (22:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index d4d1edf578f0cab6293a43ca886678268b52e5c8..c6380d49de7de071a5ed35badc58cbdb8c8431b8 100644 (file)
@@ -3656,7 +3656,15 @@ wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
     {
         wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
 
-        wxCHECK_MSG( pMenuItem && pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)),
+        // according to Carsten Fuchs the pointer may be NULL under XP if an
+        // MDI child frame is initially maximized, see this for more info:
+        // http://article.gmane.org/gmane.comp.lib.wxwidgets.general/27745
+        //
+        // so silently ignore it instead of asserting
+        if ( !pMenuItem )
+            return false;
+
+        wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem),
                         false, _T("MSWOnMeasureItem: bad wxMenuItem pointer") );
 
         size_t w, h;