Skip to content

Commit

Permalink
[automation] Correctly return the evaluation result of DSL scripts
Browse files Browse the repository at this point in the history
Fixes #1946

Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer committed Dec 16, 2020
1 parent 397ebaa commit 4059ea2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ public Object eval(String script) throws ScriptException {
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) {
Expand Down

0 comments on commit 4059ea2

Please sign in to comment.