diff options
Diffstat (limited to 'MediaBrowser.Controller/Providers/DirectoryService.cs')
| -rw-r--r-- | MediaBrowser.Controller/Providers/DirectoryService.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 828d662f6..e17ae76ff 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -1,8 +1,8 @@ -using System; +using MediaBrowser.Model.Logging; +using System; using System.Collections.Generic; using System.IO; using System.Linq; -using MediaBrowser.Model.Logging; namespace MediaBrowser.Controller.Providers { @@ -34,7 +34,15 @@ namespace MediaBrowser.Controller.Providers { //_logger.Debug("Getting files for " + path); - entries = new DirectoryInfo(path).EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly).ToList(); + try + { + entries = new DirectoryInfo(path).EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly).ToList(); + } + catch (DirectoryNotFoundException) + { + entries = new List<FileSystemInfo>(); + } + _cache.Add(path, entries); } |
