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); });