From 129c401d212930f8b317c14390c9e44998dfb516 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Tue, 17 Feb 2026 18:06:18 +0000 Subject: [PATCH] minor bug fix --- EstateReportingAPI.BusinessLogic/ReportingManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/EstateReportingAPI.BusinessLogic/ReportingManager.cs b/EstateReportingAPI.BusinessLogic/ReportingManager.cs index 2f6641a..0f9f12a 100644 --- a/EstateReportingAPI.BusinessLogic/ReportingManager.cs +++ b/EstateReportingAPI.BusinessLogic/ReportingManager.cs @@ -1338,17 +1338,22 @@ public async Task> GetTodaysSettlement(SettlementQuerie // Get the settleed fees summary DatabaseProjections.SettlementGroupProjection summary = await BuildSettlementSummaryQuery(query).SingleOrDefaultAsync(cancellationToken); - return new DatabaseProjections.SettlementGroupProjection { SettledCount = summary.SettledCount, SettledValue = summary.SettledValue, UnSettledCount = summary.UnSettledCount, UnSettledValue = summary.UnSettledValue }; + if (summary == null) + return new DatabaseProjections.SettlementGroupProjection(); + + return new DatabaseProjections.SettlementGroupProjection { SettledCount = summary.SettledCount, SettledValue = summary.SettledValue, UnSettledCount = summary.UnSettledCount, UnSettledValue = summary.UnSettledValue }; } private async Task GetSettlementSummary( IQueryable query, CancellationToken cancellationToken) { - // Get the settleed fees summary DatabaseProjections.SettlementGroupProjection summary = await BuildSettlementSummaryQuery(query).SingleOrDefaultAsync(cancellationToken); + if (summary == null) + return new DatabaseProjections.SettlementGroupProjection(); + return new DatabaseProjections.SettlementGroupProjection { SettledCount = summary.SettledCount,