Added extra check in case CopyFromIcon fails
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1662,6 +1662,13 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime)
|
|||||||
wxBitmap bmp;
|
wxBitmap bmp;
|
||||||
bmp.CopyFromIcon(ic);
|
bmp.CopyFromIcon(ic);
|
||||||
|
|
||||||
|
if ( !bmp.Ok() )
|
||||||
|
{
|
||||||
|
int newid = file;
|
||||||
|
m_HashTable->Put(extension, new wxFileIconEntry(newid));
|
||||||
|
return newid;
|
||||||
|
}
|
||||||
|
|
||||||
int id = m_smallImageList->GetImageCount();
|
int id = m_smallImageList->GetImageCount();
|
||||||
if ((bmp.GetWidth() == 16) && (bmp.GetHeight() == 16))
|
if ((bmp.GetWidth() == 16) && (bmp.GetHeight() == 16))
|
||||||
m_smallImageList->Add(bmp);
|
m_smallImageList->Add(bmp);
|
||||||
|
Reference in New Issue
Block a user