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