From da23d4269246d4448e650a70c28c5d9691360f8a Mon Sep 17 00:00:00 2001 From: dgw Date: Sun, 8 Apr 2018 05:28:49 -0500 Subject: [PATCH] Prevent "undefined" OS version in session list --- src/client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index 2349ee5c..b5f1c655 100644 --- a/src/client.js +++ b/src/client.js @@ -316,7 +316,11 @@ Client.prototype.updateSession = function(token, ip, request) { } if (agent.os.name) { - friendlyAgent += ` on ${agent.os.name} ${agent.os.version}`; + friendlyAgent += ` on ${agent.os.name}`; + + if (agent.os.version) { + friendlyAgent += ` ${agent.os.version}`; + } } client.config.sessions[token] = _.assign(client.config.sessions[token], {