From 8fe71dba4bf568e70ed740ac3413aae77559ca3c Mon Sep 17 00:00:00 2001 From: Nathan Poirier Date: Wed, 10 Aug 2022 11:56:23 +0200 Subject: [PATCH] fix(core): Fix crash caused by parallel test-webhook calls (#3756) Fix TestWebhooks undefined properties read --- packages/cli/src/TestWebhooks.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/TestWebhooks.ts b/packages/cli/src/TestWebhooks.ts index 6651660ad5..7d3faa6e58 100644 --- a/packages/cli/src/TestWebhooks.ts +++ b/packages/cli/src/TestWebhooks.ts @@ -159,8 +159,10 @@ export class TestWebhooks { } // Remove the webhook - clearTimeout(this.testWebhookData[webhookKey].timeout); - delete this.testWebhookData[webhookKey]; + if (this.testWebhookData[webhookKey]) { + clearTimeout(this.testWebhookData[webhookKey].timeout); + delete this.testWebhookData[webhookKey]; + } // eslint-disable-next-line @typescript-eslint/no-floating-promises this.activeWebhooks!.removeWorkflow(workflow); });