Fixed: Getting free space for inaccessible drive won't log an error

This commit is contained in:
Mark McDowall 2014-10-05 16:43:43 -07:00
parent 485fa6a13d
commit a433aac034
1 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@ namespace NzbDrone.Mono
try try
{ {
var driveInfo = GetDriveInfoLinux(path); var driveInfo = GetDriveInfo(path);
if (driveInfo == null) if (driveInfo == null)
{ {
@ -122,7 +122,11 @@ namespace NzbDrone.Mono
try try
{ {
return GetDriveInfoLinux(path).TotalSize; var driveInfo = GetDriveInfo(path);
if (driveInfo == null) return null;
return driveInfo.TotalSize;
} }
catch (InvalidOperationException e) catch (InvalidOperationException e)
{ {
@ -132,7 +136,7 @@ namespace NzbDrone.Mono
return null; return null;
} }
private DriveInfo GetDriveInfoLinux(string path) private DriveInfo GetDriveInfo(string path)
{ {
var drives = DriveInfo.GetDrives(); var drives = DriveInfo.GetDrives();