mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-27 06:02:33 +01:00
Handle null for parent name with clean path is empty
(cherry picked from commit bd3816dac9b540d2f95960a254bb21ab3c91421e)
This commit is contained in:
parent
77cde138dc
commit
7e218a886d
@ -101,6 +101,11 @@ public static string GetParentName(this string childPath)
|
|||||||
{
|
{
|
||||||
var cleanPath = childPath.GetCleanPath();
|
var cleanPath = childPath.GetCleanPath();
|
||||||
|
|
||||||
|
if (cleanPath.IsNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return Directory.GetParent(cleanPath)?.Name;
|
return Directory.GetParent(cleanPath)?.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user