Browse Source

Merge branch 'upstream-kwsys' into update-kwsys

Brad King 11 năm trước cách đây
mục cha
commit
391748d57e
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      Source/kwsys/Directory.cxx

+ 5 - 0
Source/kwsys/Directory.cxx

@@ -244,6 +244,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
 {
   DIR* dir = opendir(name.c_str());
 
+  if (!dir)
+    {
+    return 0;
+    }
+
   unsigned long count = 0;
   for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
     {