diff --git a/src/apps.js b/src/apps.js index 9707d48a9..e3eb863e9 100644 --- a/src/apps.js +++ b/src/apps.js @@ -494,7 +494,7 @@ function update(appId, force, manifest, portBindings, icon, callback) { assert.strictEqual(typeof appId, 'string'); assert.strictEqual(typeof force, 'boolean'); assert(manifest && typeof manifest === 'object'); - assert(!portBindings || typeof portBindings === 'object'); + assert(typeof portBindings === 'object'); // can be null assert(!icon || typeof icon === 'string'); assert.strictEqual(typeof callback, 'function'); diff --git a/src/routes/apps.js b/src/routes/apps.js index b88488b55..587096fd8 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -274,7 +274,7 @@ function updateApp(req, res, next) { debug('Update app id:%s to manifest:%j with portBindings:%j', req.params.id, data.manifest, data.portBindings); - apps.update(req.params.id, data.force || false, data.manifest, data.portBindings, data.icon, function (error) { + apps.update(req.params.id, data.force || false, data.manifest, data.portBindings || null, data.icon, function (error) { if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app')); if (error && error.reason === AppsError.BAD_FIELD) return next(new HttpError(400, error.message)); if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(409, error.message));