diff --git a/src/recent_files.cpp b/src/recent_files.cpp index 395c5fddd7..1cb8fc9a22 100644 --- a/src/recent_files.cpp +++ b/src/recent_files.cpp @@ -174,10 +174,14 @@ class file_icons wxIcon icon(fullname, wxBITMAP_TYPE_ICO, desiredSize, desiredSize); if (!icon.IsOk()) icon.LoadFile(fullname, wxBITMAP_TYPE_ICO); + + if (!icon.IsOk()) + return wxNullBitmap; + #ifndef __WXMSW__ // There is no guarantee that the desired size given at icon construction // has been taken into account - only wxMSW seems to use it - if (icon.IsOk() && (icon.GetWidth() != desiredSize || icon.GetHeight() != desiredSize)) + if (icon.GetWidth() != desiredSize || icon.GetHeight() != desiredSize) { wxImage image = icon.ConvertToImage(); image.Rescale(desiredSize, desiredSize, wxIMAGE_QUALITY_HIGH);