mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
Resolved null reference exceptions when removing a families plan sponsorship from Stripe (#4194)
This commit is contained in:
parent
6af47faef1
commit
732ded52af
@ -233,7 +233,7 @@ public class StripePaymentService : IPaymentService
|
|||||||
bool applySponsorship)
|
bool applySponsorship)
|
||||||
{
|
{
|
||||||
var existingPlan = Utilities.StaticStore.GetPlan(org.PlanType);
|
var existingPlan = Utilities.StaticStore.GetPlan(org.PlanType);
|
||||||
var sponsoredPlan = sponsorship != null ?
|
var sponsoredPlan = sponsorship?.PlanSponsorshipType != null ?
|
||||||
Utilities.StaticStore.GetSponsoredPlan(sponsorship.PlanSponsorshipType.Value) :
|
Utilities.StaticStore.GetSponsoredPlan(sponsorship.PlanSponsorshipType.Value) :
|
||||||
null;
|
null;
|
||||||
var subscriptionUpdate = new SponsorOrganizationSubscriptionUpdate(existingPlan, sponsoredPlan, applySponsorship);
|
var subscriptionUpdate = new SponsorOrganizationSubscriptionUpdate(existingPlan, sponsoredPlan, applySponsorship);
|
||||||
@ -242,8 +242,11 @@ public class StripePaymentService : IPaymentService
|
|||||||
|
|
||||||
var sub = await _stripeAdapter.SubscriptionGetAsync(org.GatewaySubscriptionId);
|
var sub = await _stripeAdapter.SubscriptionGetAsync(org.GatewaySubscriptionId);
|
||||||
org.ExpirationDate = sub.CurrentPeriodEnd;
|
org.ExpirationDate = sub.CurrentPeriodEnd;
|
||||||
sponsorship.ValidUntil = sub.CurrentPeriodEnd;
|
|
||||||
|
|
||||||
|
if (sponsorship is not null)
|
||||||
|
{
|
||||||
|
sponsorship.ValidUntil = sub.CurrentPeriodEnd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task SponsorOrganizationAsync(Organization org, OrganizationSponsorship sponsorship) =>
|
public Task SponsorOrganizationAsync(Organization org, OrganizationSponsorship sponsorship) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user