From 5f78f18cb4d3b708a329aa400e1a358d14853459 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 22 Apr 2021 12:01:09 -0700 Subject: [PATCH] Fix rendering of a choose without any action taken (#8952) --- src/components/trace/hat-trace-timeline.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/trace/hat-trace-timeline.ts b/src/components/trace/hat-trace-timeline.ts index a17cb3c81e..49898be86f 100644 --- a/src/components/trace/hat-trace-timeline.ts +++ b/src/components/trace/hat-trace-timeline.ts @@ -314,16 +314,18 @@ class ActionRenderer { if (defaultExecuted) { this._renderEntry(choosePath, `${name}: Default action executed`); - } else { + } else if (chooseTrace.result) { const choiceConfig = this._getDataFromPath( - `${this.keys[index]}/choose/${chooseTrace.result?.choice}` + `${this.keys[index]}/choose/${chooseTrace.result.choice}` ) as ChooseActionChoice | undefined; const choiceName = choiceConfig ? `${ - choiceConfig.alias || `Choice ${chooseTrace.result?.choice}` + choiceConfig.alias || `Choice ${chooseTrace.result.choice}` } executed` : `Error: ${chooseTrace.error}`; this._renderEntry(choosePath, `${name}: ${choiceName}`); + } else { + this._renderEntry(choosePath, `${name}: No action taken`); } let i;