Skip to content

Commit 37f75a8

Browse files
authored
Merge pull request #890 from bcgov/empty-reports-list-fix
Empty List Fix
2 parents f7639bc + 39602d0 commit 37f75a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/StrDss.Data/Repositories/RentalListingReportRepository.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ public async Task UpdateInactiveListings(long providingPlatformId)
128128
.Where(x => x.ProvidingOrganizationId == providingPlatformId && x.DssRentalListings.Any())
129129
.ToListAsync();
130130

131+
if (reports.Count == 0)
132+
{
133+
stopwatch.Stop();
134+
_logger.LogDebug($"UpdateInactiveListings - skipping due to no report with associated listing.");
135+
return;
136+
}
131137
var latestPeriodYm = reports.Max(x => x.ReportPeriodYm);
132138
var lastestReport = reports.First(x => x.ReportPeriodYm == latestPeriodYm);
133139

0 commit comments

Comments
 (0)