diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index cc1ee7a8a3ba5..1a10c0f4c8db0 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -180,7 +180,7 @@ export interface IRestApi { getWorkflow(id: string): Promise; getWorkflows(filter?: object): Promise; getWorkflowFromUrl(url: string): Promise; - getExecution(id: string): Promise; + getExecution(id: string): Promise; deleteExecutions(sendData: IExecutionDeleteFilter): Promise; retryExecution(id: string, loadWorkflow?: boolean): Promise; getTimezones(): Promise; diff --git a/packages/editor-ui/src/components/mixins/pushConnection.ts b/packages/editor-ui/src/components/mixins/pushConnection.ts index 38817a5ea916a..866a387673748 100644 --- a/packages/editor-ui/src/components/mixins/pushConnection.ts +++ b/packages/editor-ui/src/components/mixins/pushConnection.ts @@ -260,7 +260,7 @@ export const pushConnection = mixins( this.$titleSet(workflow.name as string, 'ERROR'); if ( - runDataExecuted.data.resultData.error!.name === 'ExpressionError' && + runDataExecuted.data.resultData.error?.name === 'ExpressionError' && (runDataExecuted.data.resultData.error as ExpressionError).context.functionality === 'pairedItem' ) { const error = runDataExecuted.data.resultData.error as ExpressionError; diff --git a/packages/editor-ui/src/components/mixins/restApi.ts b/packages/editor-ui/src/components/mixins/restApi.ts index 1a70d39671500..ecf3c48f22e3a 100644 --- a/packages/editor-ui/src/components/mixins/restApi.ts +++ b/packages/editor-ui/src/components/mixins/restApi.ts @@ -129,9 +129,9 @@ export const restApi = Vue.extend({ }, // Returns the execution with the given name - getExecution: async (id: string): Promise => { + getExecution: async (id: string): Promise => { const response = await self.restApi().makeRestApiRequest('GET', `/executions/${id}`); - return unflattenExecutionData(response); + return response && unflattenExecutionData(response); }, // Deletes executions diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 9c6508d028820..9ba2eaf4dc3b3 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1231,7 +1231,7 @@ export default mixins( } catch (error) { // Execution stop might fail when the execution has already finished. Let's treat this here. const execution = await this.restApi().getExecution(executionId); - if (execution.finished) { + if (execution?.finished) { const executedData = { data: execution.data, finished: execution.finished,