Fixes: Server error when validating UUID against empty value

This commit is contained in:
Tom Moor
2019-02-15 21:52:34 -08:00
parent 346ea4df89
commit 0b1a4c6184

View File

@ -25,7 +25,7 @@ export default function validation() {
}; };
ctx.assertUuid = (value, message) => { ctx.assertUuid = (value, message) => {
if (!validator.isUUID(value.toString())) { if (!validator.isUUID(value.toString() || '')) {
throw new ValidationError(message); throw new ValidationError(message);
} }
}; };