mirror of
https://github.com/Readarr/Readarr
synced 2026-05-09 05:21:41 +02:00
handling of blank paths during validation.
This commit is contained in:
parent
9e08dffa58
commit
daabc6364d
2 changed files with 2 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ public PathValidator()
|
||||||
|
|
||||||
protected override bool IsValid(PropertyValidatorContext context)
|
protected override bool IsValid(PropertyValidatorContext context)
|
||||||
{
|
{
|
||||||
|
if (context.PropertyValue == null) return false;
|
||||||
return context.PropertyValue.ToString().IsPathValid();
|
return context.PropertyValue.ToString().IsPathValid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ public static bool PathEquals(this string firstPath, string secondPath)
|
||||||
|
|
||||||
public static bool IsPathValid(this string path)
|
public static bool IsPathValid(this string path)
|
||||||
{
|
{
|
||||||
if (path.ContainsInvalidPathChars())
|
if (path.ContainsInvalidPathChars() || string.IsNullOrWhiteSpace(path))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue