mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
prevent a crash if the new property DerivationStrategies is notset at invoice level
This commit is contained in:
parent
aa4519ac30
commit
29aed99fd1
@ -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<string>(), network).DerivationStrategyBase;
|
||||
if (strat.Name == network.CryptoCode)
|
||||
{
|
||||
return BTCPayServer.DerivationStrategy.Parse(strat.Value.Value<string>(), network).DerivationStrategyBase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618
|
||||
if (network.IsBTC && !string.IsNullOrEmpty(DerivationStrategy))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user