소스 검색

verify path exists in realtime monitor

Luke Pulverenti 8 년 전
부모
커밋
52a183804a
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Emby.Server.Core/IO/LibraryMonitor.cs

+ 7 - 0
Emby.Server.Core/IO/LibraryMonitor.cs

@@ -288,6 +288,13 @@ namespace Emby.Server.Core.IO
             {
                 try
                 {
+                    if (!_fileSystem.DirectoryExists(path))
+                    {
+                        // Seeing a crash in the mono runtime due to an exception being thrown on a different thread
+                        Logger.Info("Skipping realtime monitor for {0} because the path does not exist", path);
+                        return;
+                    }
+
                     var newWatcher = new FileSystemWatcher(path, "*")
                     {
                         IncludeSubdirectories = true