[automation] Correctly return the evaluation result of DSL scripts

Fixes #1946

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer
2020-12-16 23:20:37 +01:00
committed by GitHub
parent 397ebaab64
commit 4059ea2422
@@ -122,11 +122,10 @@ public class DSLScriptEngine implements javax.script.ScriptEngine {
s = scriptEngine.newScriptFromString(script);
}
IEvaluationContext evalContext = createEvaluationContext(s, specificContext);
s.execute(evalContext);
return s.execute(evalContext);
} catch (ScriptExecutionException | ScriptParsingException e) {
throw new ScriptException(e.getMessage(), modelName, -1);
}
return null;
}
private DefaultEvaluationContext createEvaluationContext(Script script, IEvaluationContext specificContext) {