Fix a crash when setting a menu icon to a null bitmap in wxQt
Previous implementation didn't take into account that wxBitmap::GetHandle() could return NULL for wxQt. Specifically when wxBitmap::IsNull returns true. Closes https://github.com/wxWidgets/wxWidgets/pull/1071
This commit is contained in:
committed by
Vadim Zeitlin
parent
331dc1fdfe
commit
ac55d06bc1
@@ -111,7 +111,10 @@ void wxMenuItem::SetBitmap(const wxBitmap& bitmap)
|
||||
if ( m_kind == wxITEM_NORMAL )
|
||||
{
|
||||
m_bitmap = bitmap;
|
||||
m_qtAction->setIcon( QIcon( *m_bitmap.GetHandle() ) );
|
||||
if ( !m_bitmap.IsNull() )
|
||||
{
|
||||
m_qtAction->setIcon( QIcon(*m_bitmap.GetHandle()) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user