From b6668c257d8545a48edd1b803e1e54ba8d941aac Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 13 Jan 2004 14:37:28 +0000 Subject: [PATCH] Added extra check in case CopyFromIcon fails git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/dirctrlg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index a32eb64c4c..8f0c9536e0 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -1662,6 +1662,13 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) wxBitmap bmp; bmp.CopyFromIcon(ic); + if ( !bmp.Ok() ) + { + int newid = file; + m_HashTable->Put(extension, new wxFileIconEntry(newid)); + return newid; + } + int id = m_smallImageList->GetImageCount(); if ((bmp.GetWidth() == 16) && (bmp.GetHeight() == 16)) m_smallImageList->Add(bmp);