From 0e2cc7851f556e928e52bb2886c7d60c13b0741e Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 27 Feb 2023 01:29:16 +0200 Subject: [PATCH] Fixed: Prevent ProviderRepository to deserialize to a null config contract --- src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs | 1 - src/NzbDrone.Core/ThingiProvider/ProviderRepository.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs b/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs index 049fe02a9..4d9e62c14 100644 --- a/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs +++ b/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs @@ -171,7 +171,6 @@ namespace NzbDrone.Core.ThingiProvider definition.Message = provider.Message; } - //TODO: Remove providers even if the ConfigContract can't be deserialized (this will fail to remove providers if the settings can't be deserialized). private void RemoveMissingImplementations() { var storedProvider = _providerRepository.All(); diff --git a/src/NzbDrone.Core/ThingiProvider/ProviderRepository.cs b/src/NzbDrone.Core/ThingiProvider/ProviderRepository.cs index 50797e8df..012def6f9 100644 --- a/src/NzbDrone.Core/ThingiProvider/ProviderRepository.cs +++ b/src/NzbDrone.Core/ThingiProvider/ProviderRepository.cs @@ -55,7 +55,7 @@ namespace NzbDrone.Core.ThingiProvider var item = parser(reader); var impType = typeof(IProviderConfig).Assembly.FindTypeByName(item.ConfigContract); - if (body.IsNullOrWhiteSpace()) + if (body.IsNullOrWhiteSpace() || impType == null) { item.Settings = NullConfig.Instance; }