From 0b666482671e072d6bfab776920a6928e6b8876f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Mon, 22 Nov 2021 14:14:44 +0500 Subject: [PATCH] fix AsbCloudWebApi.Controllers.WellOperationController.ExportAsync. NullRef in WellService.Convert(). --- AsbCloudInfrastructure/Services/WellService.cs | 5 +++-- AsbCloudWebApi/appsettings.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index 679da469..f34d68a6 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -110,6 +110,7 @@ namespace AsbCloudInfrastructure.Services return dto; } + public async Task GetWellCaptionByIdAsync(int idWell, CancellationToken token) { var entity = await cacheWells.FirstOrDefaultAsync(w => w.Id == idWell, token).ConfigureAwait(false); @@ -144,8 +145,8 @@ namespace AsbCloudInfrastructure.Services { Id = well.Id, Caption = well.Caption, - Cluster = well.Cluster.Caption, - Deposit = well.Cluster.Deposit.Caption, + Cluster = well.Cluster?.Caption, + Deposit = well.Cluster?.Deposit?.Caption, LastTelemetryDate = GetLastTelemetryDate(well.Id), IdWellType = well.IdWellType ?? default, IdState = well.IdState, diff --git a/AsbCloudWebApi/appsettings.json b/AsbCloudWebApi/appsettings.json index 234b99e3..55675a79 100644 --- a/AsbCloudWebApi/appsettings.json +++ b/AsbCloudWebApi/appsettings.json @@ -7,7 +7,7 @@ } }, "ConnectionStrings": { - "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True", + "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True", "DebugConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True", "ServerConnection": "Host=192.168.1.70;Database=postgres;Username=postgres;Password=q;Persist Security Info=True", "LocalConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True"