diff --git a/src/NzbDrone.Core/Download/DownloadClientFactory.cs b/src/NzbDrone.Core/Download/DownloadClientFactory.cs index 1d98012c4..1906ffef3 100644 --- a/src/NzbDrone.Core/Download/DownloadClientFactory.cs +++ b/src/NzbDrone.Core/Download/DownloadClientFactory.cs @@ -60,9 +60,9 @@ public DownloadClientDefinition ResolveDownloadClient(int? id, string name) { var all = All(); var clientByName = name.IsNullOrWhiteSpace() ? null : all.FirstOrDefault(c => c.Name.EqualsIgnoreCase(name)); - var clientById = id.HasValue ? all.FirstOrDefault(c => c.Id == id.Value) : null; + var clientById = id is > 0 ? all.FirstOrDefault(c => c.Id == id.Value) : null; - if (id.HasValue && clientById == null) + if (id is > 0 && clientById == null) { throw new ResolveDownloadClientException("Download client with ID '{0}' could not be found", id.Value); } diff --git a/src/NzbDrone.Core/Indexers/IndexerFactory.cs b/src/NzbDrone.Core/Indexers/IndexerFactory.cs index 6fca9e540..b22e1b669 100644 --- a/src/NzbDrone.Core/Indexers/IndexerFactory.cs +++ b/src/NzbDrone.Core/Indexers/IndexerFactory.cs @@ -96,9 +96,9 @@ public IndexerDefinition ResolveIndexer(int? id, string name) { var all = All(); var clientByName = name.IsNullOrWhiteSpace() ? null : all.FirstOrDefault(c => c.Name.EqualsIgnoreCase(name)); - var clientById = id.HasValue ? all.FirstOrDefault(c => c.Id == id.Value) : null; + var clientById = id is > 0 ? all.FirstOrDefault(c => c.Id == id.Value) : null; - if (id.HasValue && clientById == null) + if (id is > 0 && clientById == null) { throw new ResolveIndexerException("Indexer with ID '{0}' could not be found", id.Value); } @@ -115,7 +115,7 @@ public IndexerDefinition ResolveIndexer(int? id, string name) if (clientByName != null && clientById != null && clientByName.Id != clientById.Id) { - throw new ResolveIndexerException("Indexer with name '{0}' does not match Indexerwith ID '{1}'", name, id.Value); + throw new ResolveIndexerException("Indexer with name '{0}' does not match indexer with ID '{1}'", name, id.Value); } return clientById ?? clientByName;