From 93cbac33fb7b2576861805cd81622810b5cb37ac Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Wed, 1 Mar 2023 22:15:25 +0000 Subject: [PATCH] fix bugs --- Common/Types/Workflow/Components/JSON.ts | 6 ++++++ CommonServer/Infrastructure/Queue.ts | 5 +++++ CommonServer/Types/Workflow/Components/JSON/MergeJson.ts | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Common/Types/Workflow/Components/JSON.ts b/Common/Types/Workflow/Components/JSON.ts index 169f2623a9..fa49c08266 100644 --- a/Common/Types/Workflow/Components/JSON.ts +++ b/Common/Types/Workflow/Components/JSON.ts @@ -149,6 +149,12 @@ const components: Array = [ 'This is executed when the JSON is successfully merged', id: 'success', }, + { + title: 'Error', + description: + 'This is executed when the JSON is not successfully merged', + id: 'error', + }, ], }, ]; diff --git a/CommonServer/Infrastructure/Queue.ts b/CommonServer/Infrastructure/Queue.ts index 5497bbd084..0f33a9ed2a 100644 --- a/CommonServer/Infrastructure/Queue.ts +++ b/CommonServer/Infrastructure/Queue.ts @@ -23,6 +23,11 @@ export default class Queue { queueName: QueueName, jobId: string ): Promise { + + if(!jobId){ + return; + } + const job: Job | undefined = await this.getQueue(queueName).getJob( jobId ); diff --git a/CommonServer/Types/Workflow/Components/JSON/MergeJson.ts b/CommonServer/Types/Workflow/Components/JSON/MergeJson.ts index e35bdb8331..d765d22ecc 100644 --- a/CommonServer/Types/Workflow/Components/JSON/MergeJson.ts +++ b/CommonServer/Types/Workflow/Components/JSON/MergeJson.ts @@ -56,9 +56,9 @@ export default class MergeJSON extends ComponentCode { args['json1'] = JSON.parse(args['json1'] as string); } - if (typeof args['json2'] !== 'object') { + if (typeof args['json1'] !== 'object') { throw options.onError( - new BadDataException('JSON2 is should be of type object.') + new BadDataException('JSON1 is should be of type object.') ); }