mirror of
https://github.com/Readarr/Readarr
synced 2026-02-26 08:31:49 +01:00
Fixed: Preferred word can't have a term that is empty or only spaces
Fixes #218 Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
e6250bfe0f
commit
cbf382625f
1 changed files with 6 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentValidation;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
|
@ -32,6 +33,11 @@ public ReleaseProfileController(IReleaseProfileService releaseProfileService, II
|
|||
{
|
||||
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");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue