From ff22e00ec506bff283bdb1874255fefe84db5766 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 30 Aug 2017 15:03:05 -0400 Subject: [PATCH] fix null refs on free org create --- src/Core/Services/Implementations/OrganizationService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index 91cd3bcfd5..dc05792744 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -527,11 +527,11 @@ namespace Bit.Core.Services UseTotp = plan.UseTotp, SelfHost = plan.SelfHost, Plan = plan.Name, - Gateway = GatewayType.Stripe, + Gateway = plan.Type == PlanType.Free ? null : (GatewayType?)GatewayType.Stripe, GatewayCustomerId = customer?.Id, GatewaySubscriptionId = subscription?.Id, Enabled = true, - ExpirationDate = subscription.CurrentPeriodEnd, + ExpirationDate = subscription?.CurrentPeriodEnd, LicenseKey = CoreHelpers.SecureRandomString(20), CreationDate = DateTime.UtcNow, RevisionDate = DateTime.UtcNow