From 5033b753ff44aecf0e5467914a7343aa339464f6 Mon Sep 17 00:00:00 2001 From: PhilRunninger Date: Mon, 1 Apr 2024 18:06:23 -0400 Subject: [PATCH] Make the obsolescence message work in and older version of node. --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }