diff --git a/app/azure/models/container_group.js b/app/azure/models/container_group.js index 2dcda73af..1f62ad372 100644 --- a/app/azure/models/container_group.js +++ b/app/azure/models/container_group.js @@ -28,7 +28,16 @@ export function ContainerGroupViewModel(data) { this.Name = data.name; this.Location = data.location; this.IPAddress = data.properties.ipAddress ? data.properties.ipAddress.ip : ''; - this.Ports = addressPorts.length ? addressPorts.map((binding, index) => ({ container: containerPorts[index].port, host: binding.port, protocol: binding.protocol })) : []; + this.Ports = addressPorts.length + ? addressPorts.map((binding, index) => { + const port = (containerPorts[index] && containerPorts[index].port) || undefined; + return { + container: port, + host: binding.port, + protocol: binding.protocol, + }; + }) + : []; this.Image = container.properties.image || ''; this.OSType = data.properties.osType; this.AllocatePublicIP = data.properties.ipAddress && data.properties.ipAddress.type === 'Public';