GetImageListBitmaps() -- don't modify if invalid

If the bitmap is empty or invalid, there is no reason to attempt to add a mask,
alpha channel, etc.
This commit is contained in:
Randalphwa 2024-01-27 11:52:48 -08:00
parent 994bc961e7
commit aa29faed81

View file

@ -167,6 +167,12 @@ void
wxImageList::GetImageListBitmaps(wxMSWBitmaps& bitmaps,
const wxBitmap& bitmap, const wxBitmap& mask)
{
if (!bitmap.IsOk())
{
// We can't do anything with an invalid bitmap.
return;
}
// This can be overwritten below if we need to modify the bitmap, but it
// doesn't cost anything to initialize the bitmap with this HBITMAP.
bitmaps.hbmp = GetHbitmapOf(bitmap);