aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/DirectoryService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Providers/DirectoryService.cs')
-rw-r--r--MediaBrowser.Controller/Providers/DirectoryService.cs18
1 files changed, 13 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs
index e7e3323c2..62d424696 100644
--- a/MediaBrowser.Controller/Providers/DirectoryService.cs
+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs
@@ -22,7 +22,7 @@ namespace MediaBrowser.Controller.Providers
_fileSystem = fileSystem;
}
- public DirectoryService(IFileSystem fileSystem)
+ public DirectoryService(IFileSystem fileSystem)
: this(new NullLogger(), fileSystem)
{
}
@@ -108,12 +108,20 @@ namespace MediaBrowser.Controller.Providers
return null;
}
- var dict = GetFileSystemDictionary(directory, false);
+ try
+ {
+ var dict = GetFileSystemDictionary(directory, false);
- FileSystemMetadata entry;
- dict.TryGetValue(path, out entry);
+ FileSystemMetadata entry;
+ dict.TryGetValue(path, out entry);
- return entry;
+ return entry;
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error in GetFileSystemDictionary. Directory: :{0}. Original path: {1}", ex, directory, path);
+ return null;
+ }
}
public IEnumerable<FileSystemMetadata> GetDirectories(string path)