From 54e0a9fc282284e57ce583ffab84efb0174a9602 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 26 Oct 2022 09:35:56 +0200 Subject: [PATCH] fix --- .../src/routes/webhooks/traefik/handlers.ts | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.ts index 15fc93224..b4fc4695d 100644 --- a/apps/api/src/routes/webhooks/traefik/handlers.ts +++ b/apps/api/src/routes/webhooks/traefik/handlers.ts @@ -407,20 +407,22 @@ export async function traefikConfiguration(request, reply) { } } } else { - let port = found.services[oneService].ports[0] - const foundPortVariable = serviceSetting.find((a) => a.name.toLowerCase() === 'port') - if (foundPortVariable) { - port = foundPortVariable.value - } - if (fqdn) { - data.services.push({ - id: oneService, - configuration: { - port - }, - fqdn, - dualCerts, - }); + if (found.services[oneService].ports) { + let port = found.services[oneService].ports[0] + const foundPortVariable = serviceSetting.find((a) => a.name.toLowerCase() === 'port') + if (foundPortVariable) { + port = foundPortVariable.value + } + if (fqdn) { + data.services.push({ + id: oneService, + configuration: { + port + }, + fqdn, + dualCerts, + }); + } } } }