diff --git a/common/app/routes/Jobs/components/NewJob.jsx b/common/app/routes/Jobs/components/NewJob.jsx index 3683895f71..83aba5ee5b 100644 --- a/common/app/routes/Jobs/components/NewJob.jsx +++ b/common/app/routes/Jobs/components/NewJob.jsx @@ -61,15 +61,15 @@ const checkboxClass = dedent` `; function formatValue(value, validator, type = 'string') { - const formated = getDefaults(type); - if (validator && type === 'string') { - formated.valid = validator(value); + const formatted = getDefaults(type); + if (validator && type === 'string' && typeof value === 'string') { + formatted.valid = validator(value); } if (value) { - formated.value = value; - formated.bsStyle = formated.valid ? 'success' : 'error'; + formatted.value = value; + formatted.bsStyle = formatted.valid ? 'success' : 'error'; } - return formated; + return formatted; } const normalizeOptions = { diff --git a/package.json b/package.json index f374969a5b..8efd96aab2 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "thundercats": "^3.1.0", "thundercats-react": "~0.5.1", "url-regex": "^3.0.0", - "validator": "^4.2.1", + "validator": "^5.0.0", "webpack": "^1.9.12", "webpack-stream": "^3.1.0", "xss-filters": "^1.2.6",