fix CalcStat on empty operations list

This commit is contained in:
Фролов 2021-08-29 12:05:43 +05:00
parent 06a492a5e5
commit 002da70471

View File

@ -195,11 +195,15 @@ namespace AsbCloudInfrastructure.Services
.Where(o => o.IdWellSectionType == idSectionType) .Where(o => o.IdWellSectionType == idSectionType)
.OrderBy(o => o.Start) .OrderBy(o => o.Start)
.ThenBy(o => o.WellDepth); .ThenBy(o => o.WellDepth);
return CalcStat(sectionOperations); return CalcStat(sectionOperations);
} }
private static StatOperationsDto CalcStat(IEnumerable<OperationParams> operations) private static StatOperationsDto CalcStat(IEnumerable<OperationParams> operations)
{ {
if (!operations.Any())
return null;
var races = GetCompleteRaces(operations); var races = GetCompleteRaces(operations);
var section = new StatOperationsDto var section = new StatOperationsDto