]> git.saurik.com Git - wxWidgets.git/commitdiff
Added extra check in case CopyFromIcon fails
authorJulian Smart <julian@anthemion.co.uk>
Tue, 13 Jan 2004 14:37:28 +0000 (14:37 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 13 Jan 2004 14:37:28 +0000 (14:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dirctrlg.cpp

index a32eb64c4ce10a6bc4a32e9e07c2cc7dbe0206b8..8f0c9536e043766fe83672126af99092978abfdd 100644 (file)
@@ -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);