Merge pull request #2340 from dgw/no-undefined-os-version

Prevent "undefined" OS version in session list
This commit is contained in:
Pavel Djundik 2018-04-08 13:53:14 +03:00 committed by GitHub
commit 7cbc0dc047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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], {