add error handling when resolving shortcuts

This commit is contained in:
Luke Pulverenti 2015-11-30 22:54:24 -05:00
parent ae76e1c725
commit 1a1fbec334
1 changed files with 27 additions and 20 deletions

View File

@ -59,6 +59,8 @@ namespace MediaBrowser.Controller.IO
var fullName = entry.FullName; var fullName = entry.FullName;
if (resolveShortcuts && fileSystem.IsShortcut(fullName)) if (resolveShortcuts && fileSystem.IsShortcut(fullName))
{
try
{ {
var newPath = fileSystem.ResolveShortcut(fullName); var newPath = fileSystem.ResolveShortcut(fullName);
@ -77,6 +79,11 @@ namespace MediaBrowser.Controller.IO
dict[newPath] = data; dict[newPath] = data;
} }
catch (Exception ex)
{
logger.ErrorException("Error resolving shortcut from {0}", ex, fullName);
}
}
else if (flattenFolderDepth > 0 && isDirectory) else if (flattenFolderDepth > 0 && isDirectory)
{ {
foreach (var child in GetFilteredFileSystemEntries(directoryService, fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) foreach (var child in GetFilteredFileSystemEntries(directoryService, fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts))