mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
Backport pull request #15468 from jellyfin/release-10.11.z
Check if target exists before trying to follow it
Original-merge: 5878b1ffc5
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
parent
d7f628677e
commit
99c68ddd50
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue