From a7f1fbf609f074c39aa5aabca3144308660f806d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 15 Nov 2001 03:07:39 +0000 Subject: [PATCH] Only update the mask if the mask is valid git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/imaglist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 12f621afce..aa3a292208 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -68,7 +68,8 @@ int wxImageList::Add( const wxBitmap &bitmap ) int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) { wxBitmap bmp(bitmap); - bmp.SetMask(new wxMask(mask)); + if (mask.Ok()) + bmp.SetMask(new wxMask(mask)); return Add(bmp); } -- 2.45.2