Skip to content

Commit

Permalink
fix: enhance getter object
Browse files Browse the repository at this point in the history
  • Loading branch information
adyfk committed Dec 12, 2023
1 parent a183e94 commit 17d899d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ExpressionParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ export class ExpressionParser {
const objectPath = token.split('.');
let objectValue = state.variables as any
for (const path of objectPath) {
objectValue = objectValue?.[path];
if (typeof objectValue !== 'object' || objectValue === null || !objectValue.hasOwnProperty(path)) {
objectValue = null as any;
break;
} else {
objectValue = objectValue[path];
}
}

Expand Down

0 comments on commit 17d899d

Please sign in to comment.