-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
improvementImprove existing behaviour or codeImprove existing behaviour or code
Description
TypeError: Cannot read properties of null (reading 'term')
at runEval (file:///workspace/node_modules/@codewars/lambda-calculus/src/lambda-calculus.js:395:20)
at result (file:///workspace/node_modules/@codewars/lambda-calculus/src/lambda-calculus.js:336:16)
This error was encountered in this code in line 395 of runeval
} else { // lastTerm is a JS function
const res = lastTerm(term);
if ( res.term ) {
({term, env} = res);
if ( ! env ) env = new Env;
} else
term = res;
}
res
may be null
or undefined
, and res.term
should be res?.term
Metadata
Metadata
Assignees
Labels
improvementImprove existing behaviour or codeImprove existing behaviour or code