From 52c8f6a79b3b9b65578866669c2e2e10b326a197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D1=80=D1=87=D0=B5=D0=BD=D0=BA=D0=BE=20=D0=92?= =?UTF-8?q?=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80?= Date: Tue, 25 Jan 2022 15:00:17 +0500 Subject: [PATCH] Fix: Added null check for cluster stats with no operations --- .../Services/WellOperationService/OperationsStatService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index effeeae2..90dc885a 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -226,7 +226,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService var operationsPlan = operations.Where(o => o.IdType == idOperationTypePlan); var operationsFact = operations.Where(o => o.IdType == idOperationTypeFact); var factEnd = CalcStat(operationsFact, timezoneOffsetH); - if (idWellState != 2) + if (factEnd is not null && idWellState != 2) factEnd.End = null; var section = new PlanFactBase {