From 002da7047142b848db56315a39fcb88dcd11e49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Sun, 29 Aug 2021 12:05:43 +0500 Subject: [PATCH] fix CalcStat on empty operations list --- AsbCloudInfrastructure/Services/WellOperationsStatService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AsbCloudInfrastructure/Services/WellOperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationsStatService.cs index 1f608a44..0798c683 100644 --- a/AsbCloudInfrastructure/Services/WellOperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationsStatService.cs @@ -195,11 +195,15 @@ namespace AsbCloudInfrastructure.Services .Where(o => o.IdWellSectionType == idSectionType) .OrderBy(o => o.Start) .ThenBy(o => o.WellDepth); + return CalcStat(sectionOperations); } private static StatOperationsDto CalcStat(IEnumerable operations) { + if (!operations.Any()) + return null; + var races = GetCompleteRaces(operations); var section = new StatOperationsDto