From 37d294d16895407e40334345d06fd27bc3ca8077 Mon Sep 17 00:00:00 2001 From: Qstick Date: Wed, 23 Sep 2020 22:29:55 -0400 Subject: [PATCH] Fixed: Preferred word can't have a term that is empty or only spaces Fixes #1361 Co-Authored-By: Mark McDowall --- src/Lidarr.Api.V1/Profiles/Release/ReleaseProfileModule.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Lidarr.Api.V1/Profiles/Release/ReleaseProfileModule.cs b/src/Lidarr.Api.V1/Profiles/Release/ReleaseProfileModule.cs index 9718c6728..1f7ca6daf 100644 --- a/src/Lidarr.Api.V1/Profiles/Release/ReleaseProfileModule.cs +++ b/src/Lidarr.Api.V1/Profiles/Release/ReleaseProfileModule.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using FluentValidation; using Lidarr.Http; using NzbDrone.Common.Extensions; @@ -34,6 +35,11 @@ namespace Lidarr.Api.V1.Profiles.Release { context.AddFailure(nameof(ReleaseProfile.IndexerId), "Indexer does not exist"); } + + if (restriction.Preferred.Any(p => p.Key.IsNullOrWhiteSpace())) + { + context.AddFailure("Preferred", "Term cannot be empty or consist of only spaces"); + } }); }