Handle null for parent name with clean path is empty

pull/5441/head
Mark McDowall 2 years ago
parent 95a8f59a32
commit bd3816dac9

@ -100,6 +100,11 @@ namespace NzbDrone.Common.Extensions
{ {
var cleanPath = childPath.GetCleanPath(); var cleanPath = childPath.GetCleanPath();
if (cleanPath.IsNullOrWhiteSpace())
{
return null;
}
return Directory.GetParent(cleanPath)?.Name; return Directory.GetParent(cleanPath)?.Name;
} }

Loading…
Cancel
Save