forked from ddrilling/AsbCloudServer
Fix fail messageController on telemetry user is null.
This commit is contained in:
parent
786e576a08
commit
711dfa681d
@ -97,9 +97,19 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
{
|
{
|
||||||
Date = message.Date,
|
Date = message.Date,
|
||||||
Id = message.Id,
|
Id = message.Id,
|
||||||
User = users.FirstOrDefault(u => u.IdUser == message.IdTelemetryUser).MakeDisplayName(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (message.IdTelemetryUser is not null)
|
||||||
|
{
|
||||||
|
if (users.Any())
|
||||||
|
{
|
||||||
|
var user = users.FirstOrDefault(u => u.IdUser == message.IdTelemetryUser);
|
||||||
|
messageDto.User = user.MakeDisplayName();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
messageDto.User = message.IdTelemetryUser.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
var e = events.FirstOrDefault(e => e.IdEvent == message.IdEvent);
|
var e = events.FirstOrDefault(e => e.IdEvent == message.IdEvent);
|
||||||
if (e != null)
|
if (e != null)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True"
|
"DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=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"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"Urls": "http://0.0.0.0:5000"
|
"Urls": "http://0.0.0.0:5000"
|
||||||
|
Loading…
Reference in New Issue
Block a user