Fix receipts for Lightning Address invoices

`AdditionalData` needs to be null-checked, because it isn't set for invoices generated via Lightning Address. 

Fixes #4169.
This commit is contained in:
Dennis Reimann 2022-09-30 23:18:59 +02:00 committed by Andrew Camilleri
parent 30f83d8f3f
commit 8155841a1d

View File

@ -176,7 +176,7 @@ namespace BTCPayServer.Controllers
});
}
JToken? receiptData = null;
i.Metadata?.AdditionalData.TryGetValue("receiptData", out receiptData);
i.Metadata?.AdditionalData?.TryGetValue("receiptData", out receiptData);
return View(new InvoiceReceiptViewModel
{