diff --git a/src/routes/apps.js b/src/routes/apps.js index 24393ebf4..b0990de13 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -151,7 +151,7 @@ function configureApp(req, res, next) { var data = req.body; if ('location' in data && typeof data.location !== 'string') return next(new HttpError(400, 'location must be string')); - data.location = addSpacesSuffix(data.location, req.user); + if ('location' in data) data.location = addSpacesSuffix(data.location, req.user); if ('domain' in data && typeof data.domain !== 'string') return next(new HttpError(400, 'domain must be string')); if ('portBindings' in data && typeof data.portBindings !== 'object') return next(new HttpError(400, 'portBindings must be an object')); if ('accessRestriction' in data && typeof data.accessRestriction !== 'object') return next(new HttpError(400, 'accessRestriction must be an object'));