mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
prevent a crash if the new property DerivationStrategies is notset at invoice level
This commit is contained in:
parent
aa4519ac30
commit
29aed99fd1
1 changed files with 8 additions and 6 deletions
|
@ -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…
Add table
Reference in a new issue