From 1ac9975baea959f4eb52faa39fcf99c1ae2bad34 Mon Sep 17 00:00:00 2001 From: Taran Vohra Date: Fri, 12 Jan 2024 17:04:40 +0530 Subject: [PATCH] check webhookId exists before deleting it in gitlab (#352) * check webhookId exists before deleting it in gitlab * Changeset --- .changeset/itchy-singers-switch.md | 5 +++++ integrations/gitlab/src/index.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/itchy-singers-switch.md diff --git a/.changeset/itchy-singers-switch.md b/.changeset/itchy-singers-switch.md new file mode 100644 index 000000000..be1e13469 --- /dev/null +++ b/.changeset/itchy-singers-switch.md @@ -0,0 +1,5 @@ +--- +'@gitbook/integration-gitlab': patch +--- + +check webhookId exists before deleting it in gitlab diff --git a/integrations/gitlab/src/index.ts b/integrations/gitlab/src/index.ts index 60eece921..746c71d90 100644 --- a/integrations/gitlab/src/index.ts +++ b/integrations/gitlab/src/index.ts @@ -389,6 +389,11 @@ const handleSpaceInstallationDeleted: EventCallback< return; } + if (!configuration.webhookId) { + logger.debug(`missing webhook id in configuration, skipping`); + return; + } + await uninstallWebhook(configuration); };