fix: ensure we have vars before attempting to fetch from them

This commit is contained in:
Bryan Ashby 2021-03-27 00:04:07 -06:00
parent 1f7545634b
commit c30b52c9d8
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 4 additions and 2 deletions

View File

@ -109,8 +109,10 @@ class TelnetClient {
// get a value from vars with fallback of user vars // get a value from vars with fallback of user vars
const getValue = (name) => { const getValue = (name) => {
return command.optionData.vars.find(nv => nv.name === name) || return command.optionData.vars &&
command.optionData.userVars.find(nv => nv.name === name); (command.optionData.vars.find(nv => nv.name === name) ||
command.optionData.userVars.find(nv => nv.name === name)
);
}; };
if ('unknown' === this.term.termType) { if ('unknown' === this.term.termType) {