Browse Source

Check if target exists before trying to follow it

Exception got caught in ManagedFileSystem and wrong file info got returned
Bond_009 1 tháng trước cách đây
mục cha
commit
3c3c2aee0d
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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)