Fix crash when only udp ports are defined

This commit is contained in:
Girish Ramakrishnan
2019-10-11 20:35:59 -07:00
parent ded9a6e377
commit 7cbe60a484
2 changed files with 2 additions and 1 deletions

View File

@@ -180,7 +180,7 @@ function createSubcontainer(app, name, cmd, options, callback) {
var portEnv = [];
for (let portName in app.portBindings) {
const hostPort = app.portBindings[portName];
const portType = portName in manifest.tcpPorts ? 'tcp' : 'udp';
const portType = (manifest.tcpPorts && portName in manifest.tcpPorts) ? 'tcp' : 'udp';
const ports = portType == 'tcp' ? manifest.tcpPorts : manifest.udpPorts;
var containerPort = ports[portName].containerPort || hostPort;