]> git.saurik.com Git - wxWidgets.git/commitdiff
complain about nonexistent directory in wxDir
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 30 Dec 2001 15:51:30 +0000 (15:51 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 30 Dec 2001 15:51:30 +0000 (15:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mgl/dir.cpp

index e819d3764436f672fcdbc0fbf3d86b60ab1939b1..b325114f1cc6eb1907aed7e41a802db8c7b141d9 100644 (file)
@@ -196,8 +196,15 @@ wxDir::wxDir(const wxString& dirname)
 bool wxDir::Open(const wxString& dirname)
 {
     delete M_DIR;
+    m_data = NULL;
+    
+    if ( !wxDir::Exists(dirname) )
+    {
+        wxLogError(_("Directory '%s' doesn't exist!"), dirname.c_str());
+        return FALSE;
+    }
+    
     m_data = new wxDirData(dirname);
-
     return TRUE;
 }