Access simple bindings directly instead of accessing them via the Groovy engine

This commit is contained in:
Reinhard Pointner 2016-10-01 01:41:30 +08:00
parent 7afe232264
commit a589cb1dcd
1 changed files with 7 additions and 1 deletions

View File

@ -270,7 +270,13 @@ public class ExpressionFormat extends Format {
@Override
public Object eval(ScriptContext context) throws ScriptException {
try {
return context.getAttribute(name);
Object value = context.getAttribute(name);
if (value == null) {
throw new MissingPropertyException(name, Variable.class);
}
return value;
} catch (Exception e) {
throw new ScriptException(e);
} catch (Throwable t) {
throw new ScriptException(new ExecutionException(t));
}