From bbc1d06598b5edc40fb59fd3ff448db4717a3a29 Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Thu, 20 Jun 2019 22:34:24 -0500 Subject: [PATCH] fix(core): filter falsy error messages from errors object on tasks (#7135) --- .../src/orchestratedItem/orchestratedItem.transformer.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.ts b/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.ts index b53fb7a895c..211d952691e 100644 --- a/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.ts +++ b/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.ts @@ -1,5 +1,6 @@ import { distanceInWords } from 'date-fns'; import { $log } from 'ngimport'; +import { get } from 'lodash'; import { IOrchestratedItem, IOrchestratedItemVariable, ITask, ITaskStep } from 'core/domain'; import { ReactInjector } from 'core/reactShims'; @@ -161,8 +162,9 @@ export class OrchestratedItemTransformer { private static getGeneralException(task: ITask): string { const generalException: any = task.getValueFor('exception'); if (generalException) { - if (generalException.details && generalException.details.errors && generalException.details.errors.length) { - return generalException.details.errors.join(', '); + const errors = get(generalException, 'details.errors', []).filter(m => !!m); + if (errors.length) { + return errors.join(', '); } if (generalException.details && generalException.details.error) { return generalException.details.error;