diff --git a/BTCPayServer/Services/Invoices/InvoiceEntity.cs b/BTCPayServer/Services/Invoices/InvoiceEntity.cs index ec9a97f21..6d7cfa84d 100644 --- a/BTCPayServer/Services/Invoices/InvoiceEntity.cs +++ b/BTCPayServer/Services/Invoices/InvoiceEntity.cs @@ -172,16 +172,18 @@ namespace BTCPayServer.Services.Invoices public DerivationStrategyBase GetDerivationStrategy(BTCPayNetwork network) { #pragma warning disable CS0618 - JObject strategies = JObject.Parse(DerivationStrategies); -#pragma warning restore CS0618 - foreach (var strat in strategies.Properties()) + if (!string.IsNullOrEmpty(DerivationStrategies)) { - if (strat.Name == network.CryptoCode) + JObject strategies = JObject.Parse(DerivationStrategies); +#pragma warning restore CS0618 + foreach (var strat in strategies.Properties()) { - return BTCPayServer.DerivationStrategy.Parse(strat.Value.Value(), network).DerivationStrategyBase; + if (strat.Name == network.CryptoCode) + { + return BTCPayServer.DerivationStrategy.Parse(strat.Value.Value(), network).DerivationStrategyBase; + } } } - #pragma warning disable CS0618 if (network.IsBTC && !string.IsNullOrEmpty(DerivationStrategy)) {