diff --git a/NzbDrone.Api/Validation/PathValidator.cs b/NzbDrone.Api/Validation/PathValidator.cs index bc055a98c..f7cf37eab 100644 --- a/NzbDrone.Api/Validation/PathValidator.cs +++ b/NzbDrone.Api/Validation/PathValidator.cs @@ -12,6 +12,7 @@ public PathValidator() protected override bool IsValid(PropertyValidatorContext context) { + if (context.PropertyValue == null) return false; return context.PropertyValue.ToString().IsPathValid(); } } diff --git a/NzbDrone.Common/PathExtensions.cs b/NzbDrone.Common/PathExtensions.cs index 68938c55a..15687895f 100644 --- a/NzbDrone.Common/PathExtensions.cs +++ b/NzbDrone.Common/PathExtensions.cs @@ -50,7 +50,7 @@ public static bool PathEquals(this string firstPath, string secondPath) public static bool IsPathValid(this string path) { - if (path.ContainsInvalidPathChars()) + if (path.ContainsInvalidPathChars() || string.IsNullOrWhiteSpace(path)) { return false; }