Avoid normalizing empty fields (#645)

This commit is contained in:
Esther Lozano 2020-02-26 17:58:32 +01:00 committed by GitHub
parent 419adea234
commit 0a68b48acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,10 @@ function getEventData (req, res) {
} }
function normalizedField (field) { function normalizedField (field) {
if (!field) {
return undefined;
}
return field.toString().trim().substr(0, MAX_LENGTH); return field.toString().trim().substr(0, MAX_LENGTH);
} }