diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index 1ad87888ba..4d969b52ab 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -86,7 +86,14 @@ int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask) HBITMAP hBitmap2 = 0; if ( mask.Ok() ) hBitmap2 = (HBITMAP) mask.GetHBITMAP(); - return ImageList_Add((HIMAGELIST) GetHIMAGELIST(), hBitmap1, hBitmap2); + + int index = ImageList_Add((HIMAGELIST) GetHIMAGELIST(), hBitmap1, hBitmap2); + if ( index == -1 ) + { + wxLogError(_("Couldn't add an image to the image list.")); + } + + return index; } // Adds a bitmap, using the specified colour to create the mask bitmap