From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 6 Aug 2008 10:25:10 +0000 (+0000)
Subject: replace wxASSERT in wxFindNextFile() with wxCHECK to avoid crashes in release build... 
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/31004b74058ca584729db0b7fe889ea89d89ff14

replace wxASSERT in wxFindNextFile() with wxCHECK to avoid crashes in release build (#9828)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp
index 0597305a5e..7a8f627a55 100644
--- a/src/common/filefn.cpp
+++ b/src/common/filefn.cpp
@@ -1408,8 +1408,7 @@ wxString wxFindFirstFile(const wxString& spec, int flags)
     if ( !wxEndsWithPathSeparator(gs_dirPath ) )
         gs_dirPath << wxFILE_SEP_PATH;
 
-    if (gs_dir)
-        delete gs_dir;
+    delete gs_dir; // can be NULL, this is ok
     gs_dir = new wxDir(gs_dirPath);
 
     if ( !gs_dir->IsOpened() )
@@ -1439,7 +1438,7 @@ wxString wxFindFirstFile(const wxString& spec, int flags)
 
 wxString wxFindNextFile()
 {
-    wxASSERT_MSG( gs_dir, wxT("You must call wxFindFirstFile before!") );
+    wxCHECK_MSG( gs_dir, "", "You must call wxFindFirstFile before!" );
 
     wxString result;
     gs_dir->GetNext(&result);