Return an empty list instead of null

This commit is contained in:
de4dot 2011-11-02 02:28:51 +01:00
parent 8ff2115083
commit 2ddf6b00de

View File

@ -245,10 +245,10 @@ namespace de4dot {
IEnumerable<string> doDirectoryInfo(SearchDir searchDir, DirectoryInfo di) {
if (!di.Exists)
return null;
return new List<string>();
if (visitedDirectory.ContainsKey(di.FullName))
return null;
return new List<string>();
visitedDirectory[di.FullName] = true;
FileSystemInfo[] fsinfos;
@ -256,10 +256,10 @@ namespace de4dot {
fsinfos = di.GetFileSystemInfos();
}
catch (UnauthorizedAccessException) {
return null;
return new List<string>();
}
catch (IOException) {
return null;
return new List<string>();
}
return recursiveAdd(searchDir, fsinfos);
}