[automation] Correctly return the evaluation result of DSL scripts

Fixes #1946

Signed-off-by: Kai Kreuzer <kai@openhab.org>
pull/1884/head
Kai Kreuzer 2020-12-16 23:20:37 +01:00 committed by GitHub
parent 397ebaab64
commit 4059ea2422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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) {