]> git.saurik.com Git - wxWidgets.git/blobdiff - src/ribbon/art_aui.cpp
Fix crash by checking if icon is valid before drawing it, fixes #12376: PATCH for...
[wxWidgets.git] / src / ribbon / art_aui.cpp
index a0f40869f542235ee7fc9a38d500923e6e8a3a0b..d127da85bc1d8bb26e9fdf62fe7ad6eed4e34bbc 100644 (file)
@@ -387,9 +387,12 @@ void wxRibbonAUIArtProvider::DrawTab(wxDC& dc,
         icon = tab.page->GetIcon();
         if((m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) == 0)
         {
+            if(icon.IsOk())
+            {
             int x = tab.rect.x + (tab.rect.width - icon.GetWidth()) / 2;
             dc.DrawBitmap(icon, x, tab.rect.y + 1 + (tab.rect.height - 1 -
                 icon.GetHeight()) / 2, true);
+            }
         }
     }
     if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)