From 32b5fee108b0662b771d8eaf74e79a5c0ff85760 Mon Sep 17 00:00:00 2001 From: James Read Date: Tue, 15 Oct 2024 11:48:55 +0100 Subject: [PATCH] bugfix: Fixed crash when requesting execution status that could not be found (NPE) (#440) --- internal/grpcapi/grpcApi.go | 3 ++- webui.dev/js/marshaller.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/grpcapi/grpcApi.go b/internal/grpcapi/grpcApi.go index 7f94909..743548e 100644 --- a/internal/grpcapi/grpcApi.go +++ b/internal/grpcapi/grpcApi.go @@ -213,12 +213,13 @@ func (api *oliveTinAPI) ExecutionStatus(ctx ctx.Context, req *pb.ExecutionStatus if req.ExecutionTrackingId != "" { ile = getExecutionStatusByTrackingID(api, req.ExecutionTrackingId) + } else { ile = getMostRecentExecutionStatusById(api, req.ActionId) } if ile == nil { - return nil, status.Errorf(codes.NotFound, "Execution not found.") + return nil, status.Error(codes.NotFound, "Execution not found") } else { res.LogEntry = internalLogEntryToPb(ile) } diff --git a/webui.dev/js/marshaller.js b/webui.dev/js/marshaller.js index 35ff403..4cd5636 100644 --- a/webui.dev/js/marshaller.js +++ b/webui.dev/js/marshaller.js @@ -407,7 +407,7 @@ function marshalMreOutput (dashboardComponent, fieldset) { }) const updateMre = (pre, json) => { - pre.innerHTML = json.stdout + pre.innerHTML = json.output } window.addEventListener('ExecutionFinished', (e) => {