Skip to content

Commit

Permalink
Only filter out progress output if it actually exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nturinski committed Aug 21, 2024
1 parent 2ee5b4e commit 54b59b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion utils/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"**/node_modules": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
11 changes: 8 additions & 3 deletions utils/src/wizard/AzureWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ export class AzureWizard<T extends (IInternalActionContext & Partial<types.Execu
}

let output: types.ExecuteActivityOutput | undefined;
const progressOutput = step.createProgressOutput?.(this._context) ?? {};
this.displayActivityOutput(progressOutput, step.options);
const progressOutput: types.ExecuteActivityOutput | undefined = step.createProgressOutput?.(this._context);
if (progressOutput) {
this.displayActivityOutput(progressOutput, step.options);
}

try {
this._context.telemetry.properties.lastStep = `execute-${getEffectiveStepId(step)}`;
Expand All @@ -209,7 +211,10 @@ export class AzureWizard<T extends (IInternalActionContext & Partial<types.Execu
output ??= {};

// always remove the progress item from the activity log
this._context.activityChildren = this._context.activityChildren?.filter(t => t !== progressOutput.item)
if (progressOutput?.item) {
this._context.activityChildren = this._context.activityChildren?.filter(t => t !== progressOutput.item);
}

this.displayActivityOutput(output, step.options);

currentStep += 1;
Expand Down

0 comments on commit 54b59b3

Please sign in to comment.