diff --git a/index.js b/index.js index db2e051..45a2753 100644 --- a/index.js +++ b/index.js @@ -71,7 +71,11 @@ function process_route(route, description, path, req, res, callback) { } if (!supported_version(req.body.version)) { - console.log(`${timestamp()} ${error()}${req.body.username ?? 'Anonymous'} is using a too-old version of the client - ${req.body.version}`); + if (req.body.username) { + console.log(`${timestamp()} ${error()}${req.body.username} is using a too-old version of the client - ${req.body.version}`); + } else { + console.log(`${timestamp()} ${error()}'Anonymous user is using a too-old version of the client - ${req.body.version}`); + } res.send(`Obsolete client workbook, version ${req.body.version}`); return; }