From 00b08cacafae7a9e17a770b685d5b7de4f293c24 Mon Sep 17 00:00:00 2001 From: Justin Reynolds Date: Wed, 19 Apr 2017 20:59:13 -0700 Subject: [PATCH] fix(core/delivery): Fix an undefined when there is no firstActiveStage --- .../core/delivery/executionGroup/execution/Execution.tsx | 3 ++- app/scripts/modules/core/domain/IExecutionStage.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/modules/core/delivery/executionGroup/execution/Execution.tsx b/app/scripts/modules/core/delivery/executionGroup/execution/Execution.tsx index d0a8edd8f91..1688c350ee2 100644 --- a/app/scripts/modules/core/delivery/executionGroup/execution/Execution.tsx +++ b/app/scripts/modules/core/delivery/executionGroup/execution/Execution.tsx @@ -121,10 +121,11 @@ export class Execution extends React.Component return; } const index = stageIndex || 0; + const stageSummary = this.props.execution.stageSummaries[index] || { firstActiveStage: 0 }; const params = { executionId: this.props.execution.id, stage: index, - step: this.props.execution.stageSummaries[index].firstActiveStage + step: stageSummary.firstActiveStage }; if (stateService.includes('**.execution', params)) { diff --git a/app/scripts/modules/core/domain/IExecutionStage.ts b/app/scripts/modules/core/domain/IExecutionStage.ts index 3d1a0a844bb..e5821995567 100644 --- a/app/scripts/modules/core/domain/IExecutionStage.ts +++ b/app/scripts/modules/core/domain/IExecutionStage.ts @@ -19,6 +19,7 @@ export interface IExecutionStage extends IOrchestratedItem, IStage { id: string; tasks: IStageStep[]; context: IExecutionContext; + firstActiveStage?: number; } export interface IExecutionStageSummary extends IExecutionStage {