NIHVIVO-2470 Restore parameter type checking on DumpDirective and HelpDirective. Handle undefined variables by assigning value = "Undefined."
This commit is contained in:
parent
84f779238c
commit
d64d45d8e6
4 changed files with 21 additions and 7 deletions
|
@ -40,8 +40,13 @@ public class HelpDirective extends BaseDumpDirective {
|
|||
throw new TemplateModelException(
|
||||
"Must specify 'for' argument.");
|
||||
}
|
||||
|
||||
String varName = params.get("var").toString();
|
||||
|
||||
if ( !(o instanceof SimpleScalar)) {
|
||||
throw new TemplateModelException(
|
||||
"Value of parameter 'for' must be a string.");
|
||||
}
|
||||
|
||||
String varName = o.toString(); //((SimpleScalar)o).getAsString();
|
||||
TemplateHashModel dataModel = env.getDataModel();
|
||||
Object templateModel = dataModel.get(varName);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue