Warning if not using 'is not null'

This commit is contained in:
nicolas.dorier
2022-01-14 17:48:15 +09:00
parent 5cbc2e96e7
commit c6a7e90c1a
9 changed files with 13 additions and 11 deletions

View File

@@ -419,7 +419,7 @@ namespace BTCPayServer.Controllers
{
var enabled = storeData.GetEnabledPaymentIds(_NetworkProvider);
var defaultPaymentId = storeData.GetDefaultPaymentId();
var defaultChoice = defaultPaymentId is PaymentMethodId ? defaultPaymentId.FindNearest(enabled) : null;
var defaultChoice = defaultPaymentId is not null ? defaultPaymentId.FindNearest(enabled) : null;
if (defaultChoice is null)
{
defaultChoice = enabled.FirstOrDefault(e => e.CryptoCode == "BTC" && e.PaymentType == PaymentTypes.BTCLike) ??