Fixed: Replaced mono symlink resolve logic to better handle errors.

This commit is contained in:
Taloth Saldono
2016-02-11 01:13:07 +01:00
parent bd6a38173e
commit 1c92ea58da
5 changed files with 144 additions and 8 deletions
+13 -5
View File
@@ -383,12 +383,20 @@ namespace NzbDrone.Common.Disk
public virtual IMount GetMount(string path)
{
var mounts = GetMounts();
try
{
var mounts = GetMounts();
return mounts.Where(drive => drive.RootDirectory.PathEquals(path) ||
drive.RootDirectory.IsParentPath(path))
.OrderByDescending(drive => drive.RootDirectory.Length)
.FirstOrDefault();
return mounts.Where(drive => drive.RootDirectory.PathEquals(path) ||
drive.RootDirectory.IsParentPath(path))
.OrderByDescending(drive => drive.RootDirectory.Length)
.FirstOrDefault();
}
catch (Exception ex)
{
Logger.DebugException(string.Format("Failed to get mount for path {0}", path), ex);
return null;
}
}
protected List<IMount> GetDriveInfoMounts()