1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(service-details): fix an update issue when no ports are defined (#765)

This commit is contained in:
Anthony Lapenna 2017-04-06 09:35:01 +01:00 committed by GitHub
parent 80a0a15490
commit 3fc54c095e

View file

@ -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',