Przeglądaj źródła

Check if target exists before trying to follow it

Exception got caught in ManagedFileSystem and wrong file info got returned
Bond_009 1 miesiąc temu
rodzic
commit
3c3c2aee0d
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      MediaBrowser.Controller/IO/FileSystemHelper.cs

+ 5 - 0
MediaBrowser.Controller/IO/FileSystemHelper.cs

@@ -92,6 +92,11 @@ public static class FileSystemHelper
             return null;
         }
 
+        if (!targetInfo.Exists)
+        {
+            return targetInfo;
+        }
+
         var currentPath = targetInfo.FullName;
         var visited = new HashSet<string>(StringComparer.Ordinal) { linkPath, currentPath };
         while (File.ResolveLinkTarget(currentPath, returnFinalTarget: false) is FileInfo linkInfo)