From 3fc54c095e7a4e386198339feb120ba8aebd8202 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 6 Apr 2017 09:35:01 +0100 Subject: [PATCH] fix(service-details): fix an update issue when no ports are defined (#765) --- app/components/service/serviceController.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/components/service/serviceController.js b/app/components/service/serviceController.js index afd0a5e93..961aa17b3 100644 --- a/app/components/service/serviceController.js +++ b/app/components/service/serviceController.js @@ -198,11 +198,13 @@ function ($scope, $stateParams, $state, $location, $anchorScroll, Service, Servi Window: service.RestartWindow }; - service.Ports.forEach(function (binding) { - if (binding.PublishedPort === null || binding.PublishedPort === '') { - delete binding.PublishedPort; - } - }); + if (service.Ports) { + service.Ports.forEach(function (binding) { + if (binding.PublishedPort === null || binding.PublishedPort === '') { + delete binding.PublishedPort; + } + }); + } config.EndpointSpec = { Mode: config.EndpointSpec.Mode || 'vip',