From c30b52c9d87191e86be20661786fc0d7a3f8ce30 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 27 Mar 2021 00:04:07 -0600 Subject: [PATCH] fix: ensure we have vars before attempting to fetch from them --- core/servers/login/telnet.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/servers/login/telnet.js b/core/servers/login/telnet.js index 12a3ed36..a6daa89e 100644 --- a/core/servers/login/telnet.js +++ b/core/servers/login/telnet.js @@ -109,8 +109,10 @@ class TelnetClient { // get a value from vars with fallback of user vars const getValue = (name) => { - return command.optionData.vars.find(nv => nv.name === name) || - command.optionData.userVars.find(nv => nv.name === name); + return command.optionData.vars && + (command.optionData.vars.find(nv => nv.name === name) || + command.optionData.userVars.find(nv => nv.name === name) + ); }; if ('unknown' === this.term.termType) {