From eddc8712b0e166b1889426302161771542ca46e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 12 Jul 2017 13:33:10 +0100 Subject: [PATCH] fix(portal-api): prevent crash on cp-watcher when no services --- packages/portal-api/lib/watch/container-pilot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/portal-api/lib/watch/container-pilot.js b/packages/portal-api/lib/watch/container-pilot.js index d909c35e..89206bc4 100644 --- a/packages/portal-api/lib/watch/container-pilot.js +++ b/packages/portal-api/lib/watch/container-pilot.js @@ -73,6 +73,10 @@ module.exports = class ContainerPilotWatcher extends Events { return next(err); } + if (!services || !services.length) { + return next(); + } + VAsync.forEachParallel({ inputs: services, func: getInstances