From 2c6c0fcc81e82698c968d25dcd63ec332b10c23c Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 25 Oct 2023 17:11:48 +0300 Subject: [PATCH] Allow 0 as value in download client Id validation --- .../Validation/DownloadClientExistsValidator.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Validation/DownloadClientExistsValidator.cs b/src/NzbDrone.Core/Validation/DownloadClientExistsValidator.cs index 28f571483..cf021f464 100644 --- a/src/NzbDrone.Core/Validation/DownloadClientExistsValidator.cs +++ b/src/NzbDrone.Core/Validation/DownloadClientExistsValidator.cs @@ -16,7 +16,12 @@ namespace NzbDrone.Core.Validation protected override bool IsValid(PropertyValidatorContext context) { - return context?.PropertyValue == null || _downloadClientFactory.Exists((int)context.PropertyValue); + if (context?.PropertyValue == null || (int)context.PropertyValue == 0) + { + return true; + } + + return _downloadClientFactory.Exists((int)context.PropertyValue); } } }