]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
Make code reading BMP files more robust.
[wxWidgets.git] / src / common / filefn.cpp
index 2e04e80098cb9d0233f83ef37ca598cf4315d576..cb035c4407febe962cf67aa95cecfc61351ef3a5 100644 (file)
@@ -61,6 +61,7 @@
 
 #ifdef __WINDOWS__
     #include "wx/msw/private.h"
+    #include "wx/msw/missing.h"
     #include "wx/msw/mslu.h"
 
     // sys/cygwin.h is needed for cygwin_conv_to_full_win32_path()
@@ -1355,9 +1356,7 @@ wxString wxFindNextFile()
     wxCHECK_MSG( gs_dir, "", "You must call wxFindFirstFile before!" );
 
     wxString result;
-    gs_dir->GetNext(&result);
-
-    if ( result.empty() )
+    if ( !gs_dir->GetNext(&result) || result.empty() )
     {
         wxDELETE(gs_dir);
         return result;