1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-13 00:26:55 -05:00

Add check for undefined in canonicalize middleware

This commit is contained in:
Jack Foltz 2018-07-27 14:08:41 -04:00
parent 094a45b6be
commit 230f9c2415
Signed by: foltik
GPG Key ID: 303F88F996E95541

View File

@ -3,6 +3,6 @@ exports.canonicalize = displayname => displayname.normalize('NFKD').toLowerCase(
exports.canonicalizeRequest =
(req, res, next) => {
req.body.username = exports.canonicalize(req.body.displayname);
req.body.username = req.body.displayname ? exports.canonicalize(req.body.displayname) : undefined;
next();
};