From 1ddfdd12ccc8f1dff3ca59b5fcdb617e12312550 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Wed, 22 May 2024 17:21:09 -0700 Subject: [PATCH] CU-8687yhbz5 trying to fix bug in sub controller --- .../Areas/User/Controllers/SubscriptionController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Web/Resgrid.WebCore/Areas/User/Controllers/SubscriptionController.cs b/Web/Resgrid.WebCore/Areas/User/Controllers/SubscriptionController.cs index da0dc806..0d64fa6c 100644 --- a/Web/Resgrid.WebCore/Areas/User/Controllers/SubscriptionController.cs +++ b/Web/Resgrid.WebCore/Areas/User/Controllers/SubscriptionController.cs @@ -98,7 +98,10 @@ public async Task Index() } var allPayments = await _subscriptionsService.GetAllPaymentsForDepartmentAsync(DepartmentId); - model.HadStripePaymentIn30Days = allPayments.Any(x => x.EndingOn >= DateTime.UtcNow.AddYears(-2) && x.Method == (int)PaymentMethods.Stripe); + if (allPayments != null) + model.HadStripePaymentIn30Days = allPayments.Any(x => x.EndingOn >= DateTime.UtcNow.AddYears(-2) && x.Method == (int)PaymentMethods.Stripe); + else + model.HadStripePaymentIn30Days = false; if (model.Payment != null) {