diff --git a/src/routes/profile.js b/src/routes/profile.js index fac04e612..1491618c4 100644 --- a/src/routes/profile.js +++ b/src/routes/profile.js @@ -117,7 +117,7 @@ async function setLanguage(req, res, next) { assert.strictEqual(typeof req.user, 'object'); assert.strictEqual(typeof req.body, 'object'); - if ('language' in req.body && typeof req.body.language !== 'string') return next(new HttpError(400, 'language must be string')); + if (typeof req.body.language !== 'string') return next(new HttpError(400, 'language must be string')); const [error] = await safe(users.update(req.user, { language: req.body.language }, AuditSource.fromRequest(req))); if (error) return next(BoxError.toHttpError(error));