Fix crash when location is not provided

This commit is contained in:
Girish Ramakrishnan
2018-08-30 22:08:48 -07:00
parent fc96f59ecc
commit fc3bc48f47

View File

@@ -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'));