Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VfsFileSystem: ignore not supported symlink #264

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions Library/DiscUtils.Core/Vfs/VfsFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,27 @@ private void DoSearch(List<string> results, string path, Regex regex, bool subFo

if (entry.IsSymlink)
{
entry = ResolveSymlink(entry, path + "\\" + entry.FileName);
}
if(entry == null)
{
continue;
try
{
entry = ResolveSymlink(entry, path + "\\" + entry.FileName);

if (entry == null)
{
// Symlink doesn't resolve to a valid entry, ignore it
continue;
}
}
catch (NotImplementedException)
{
// If the underlying doesn't support symlink, ignore it to still allow
// to work with all other entries
continue;
}
catch (NotSupportedException)
{
// Same as for NotImplementedException
continue;
}
}

bool isDir = entry.IsDirectory;
Expand Down