1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00

Handle null for parent name with clean path is empty

This commit is contained in:
Mark McDowall 2023-02-20 17:20:07 -08:00
parent 95a8f59a32
commit bd3816dac9

View File

@ -100,6 +100,11 @@ public static string GetParentName(this string childPath)
{
var cleanPath = childPath.GetCleanPath();
if (cleanPath.IsNullOrWhiteSpace())
{
return null;
}
return Directory.GetParent(cleanPath)?.Name;
}