3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

evaluateTemplateVariable: require property to be a direct/own property of 'values', not from its prototype

This commit is contained in:
Dragory 2019-04-13 04:11:24 +03:00
parent f76dd3ed62
commit 40cb74ee28
3 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,4 @@
import has from "lodash.has";
import at from "lodash.at";
const TEMPLATE_CACHE_SIZE = 100;
@ -218,7 +219,7 @@ export function parseTemplate(str: string): ParsedTemplate {
}
async function evaluateTemplateVariable(theVar: ITemplateVar, values) {
const value = at(values, theVar.identifier)[0];
const value = has(values, theVar.identifier) && at(values, theVar.identifier)[0];
if (typeof value === "function") {
const args = [];