1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-08-18 00:09:37 +02:00

Handle null for parent name with clean path is empty

(cherry picked from commit bd3816dac9b540d2f95960a254bb21ab3c91421e)
This commit is contained in:
Mark McDowall 2023-02-20 17:20:07 -08:00 committed by Bogdan
parent 77cde138dc
commit 7e218a886d

View File

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