1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-25 23:02:17 -05:00

Add invoice null check (#5642)

This commit is contained in:
Alex Morask 2025-04-11 09:34:51 -04:00 committed by Alex Morask
parent 5db89f29f2
commit cff949c231
No known key found for this signature in database
GPG Key ID: 23E38285B743E3A8

View File

@ -93,7 +93,9 @@ public class OrganizationBillingService(
var isOnSecretsManagerStandalone = await IsOnSecretsManagerStandalone(organization, customer, subscription);
var invoice = await stripeAdapter.InvoiceGetAsync(subscription.LatestInvoiceId, new InvoiceGetOptions());
var invoice = !string.IsNullOrEmpty(subscription.LatestInvoiceId)
? await stripeAdapter.InvoiceGetAsync(subscription.LatestInvoiceId, new InvoiceGetOptions())
: null;
return new OrganizationMetadata(
isEligibleForSelfHost,