fixed #834: Indexer catch unauthorized access exception

This commit is contained in:
Jaex 2015-08-03 10:23:32 +03:00
parent 6d6e338bf1
commit e2746e47e3
2 changed files with 24 additions and 18 deletions

View file

@ -196,7 +196,7 @@ public static bool IsBlurPossible(int radius)
Version version = Environment.OSVersion.Version;
bool isWindows8OrHigher = (version.Major == 6 && version.Minor >= 2) || version.Major > 6;
return !isWindows8OrHigher || radius >= 20; ;
return !isWindows8OrHigher || radius >= 20;
}
/// <summary>

View file

@ -76,6 +76,8 @@ protected FolderInfo GetFolderInfo(string folderPath, int level = 0)
FolderInfo folderInfo = new FolderInfo(folderPath);
if (config.MaxDepthLevel == 0 || level < config.MaxDepthLevel)
{
try
{
DirectoryInfo currentDirectoryInfo = new DirectoryInfo(folderPath);
@ -103,6 +105,10 @@ protected FolderInfo GetFolderInfo(string folderPath, int level = 0)
folderInfo.Files.Sort((x, y) => x.Name.CompareTo(y.Name));
}
catch (UnauthorizedAccessException)
{
}
}
return folderInfo;
}