1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

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

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));
}