Avoid exception being thrown when server status updates from service

This commit is contained in:
Pat Hartl 2023-11-04 22:22:37 -05:00
parent 03626a75d0
commit bd15ceaa5b

View file

@ -81,23 +81,21 @@
if (args?.Server?.Id == ServerId) if (args?.Server?.Id == ServerId)
{ {
Status = args.Status; Status = args.Status;
StateHasChanged();
if (Status == ServerProcessStatus.Error) if (Status == ServerProcessStatus.Error)
{ {
NotificationService.Error(new NotificationConfig NotificationService.Error(new NotificationConfig
{ {
Message = $"Error starting server {args.Server.Name}", Message = $"Error starting server {args.Server.Name}",
Description = args.Exception.Message, Description = args.Exception.Message,
} });
);
} }
} }
} }
private async Task Start() private async Task Start()
{ {
ServerProcessService.StartServerAsync(Server); await ServerProcessService.StartServerAsync(Server);
} }
private void Stop() private void Stop()