fix assert for bitmaps buttons created without bitmap initially

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-09-12 00:21:48 +00:00
parent 479647105b
commit e040a4ff2c

View File

@ -227,7 +227,7 @@ void wxBitmapButton::OnMouseEnterOrLeave(wxMouseEvent& event)
void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
{
#if wxUSE_IMAGE
if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser )
if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser && bitmap.IsOk() )
{
m_bmpDisabled = wxBitmap(bitmap.ConvertToImage().ConvertToGreyscale());
}