From cfe9812724717b9f9a5764a887ebb0c4244a386d Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Thu, 2 Nov 2023 10:23:28 -0400 Subject: [PATCH] [AC-1772] Check null or whitespace on `GatewayCustomerId` and `BillingEmail` (#3398) * Check null or whitespace on GatewayCustomerId and BillingEmail * Fixed expiration input --- src/Admin/Controllers/OrganizationsController.cs | 5 ++++- src/Admin/Views/Shared/_OrganizationForm.cshtml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Admin/Controllers/OrganizationsController.cs b/src/Admin/Controllers/OrganizationsController.cs index b3a232c2c8ba..f671df558d80 100644 --- a/src/Admin/Controllers/OrganizationsController.cs +++ b/src/Admin/Controllers/OrganizationsController.cs @@ -215,7 +215,10 @@ public async Task Edit(Guid id, OrganizationEditModel model) try { - await _stripeSyncService.UpdateCustomerEmailAddress(organization.GatewayCustomerId, organization.BillingEmail); + if (!string.IsNullOrWhiteSpace(organization.GatewayCustomerId) && !string.IsNullOrWhiteSpace(organization.BillingEmail)) + { + await _stripeSyncService.UpdateCustomerEmailAddress(organization.GatewayCustomerId, organization.BillingEmail); + } } catch (StripeException stripeException) { diff --git a/src/Admin/Views/Shared/_OrganizationForm.cshtml b/src/Admin/Views/Shared/_OrganizationForm.cshtml index d0530849acbd..9e1b488b173c 100644 --- a/src/Admin/Views/Shared/_OrganizationForm.cshtml +++ b/src/Admin/Views/Shared/_OrganizationForm.cshtml @@ -259,7 +259,7 @@
- +