fix(core): Fix crash caused by parallel test-webhook calls (#3756)

Fix TestWebhooks undefined properties read
This commit is contained in:
Nathan Poirier 2022-08-10 11:56:23 +02:00 committed by GitHub
parent 7b3d6de44e
commit 8fe71dba4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,8 +159,10 @@ export class TestWebhooks {
} }
// Remove the webhook // Remove the webhook
clearTimeout(this.testWebhookData[webhookKey].timeout); if (this.testWebhookData[webhookKey]) {
delete this.testWebhookData[webhookKey]; clearTimeout(this.testWebhookData[webhookKey].timeout);
delete this.testWebhookData[webhookKey];
}
// eslint-disable-next-line @typescript-eslint/no-floating-promises // eslint-disable-next-line @typescript-eslint/no-floating-promises
this.activeWebhooks!.removeWorkflow(workflow); this.activeWebhooks!.removeWorkflow(workflow);
}); });