From 219494ea9d120bb809e787c246f30dd92050e09a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 29 Mar 2020 14:54:14 -0700 Subject: [PATCH] Fixed: Preferred word can't have a term that is empty or only spaces --- src/Sonarr.Api.V3/Profiles/Release/ReleaseProfileModule.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Sonarr.Api.V3/Profiles/Release/ReleaseProfileModule.cs b/src/Sonarr.Api.V3/Profiles/Release/ReleaseProfileModule.cs index 1d6c75ab0..ed8587083 100644 --- a/src/Sonarr.Api.V3/Profiles/Release/ReleaseProfileModule.cs +++ b/src/Sonarr.Api.V3/Profiles/Release/ReleaseProfileModule.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using FluentValidation; using FluentValidation.Results; using NzbDrone.Common.Extensions; @@ -36,6 +37,11 @@ namespace Sonarr.Api.V3.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"); + } }); }