Skip to content

Commit c33942f

Browse files
committed
Skip script compilation if no ScriptEngine found for language
Signed-off-by: Florian Hotze <[email protected]>
1 parent 41bcd8d commit c33942f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/handler/AbstractScriptModuleHandler.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,19 @@ private static String getValidConfigParameter(String parameter, Configuration co
8787
}
8888

8989
/**
90-
* Creates the {@link ScriptEngine} and compiles the script if the {@link ScriptEngine} implements {@link Compilable}.
90+
* Creates the {@link ScriptEngine} and compiles the script if the {@link ScriptEngine} implements
91+
* {@link Compilable}.
9192
*/
9293
protected void compileScript() throws ScriptException {
9394
if (compiledScript.isPresent()) {
9495
return;
9596
}
97+
if (!scriptEngineManager.isSupported(this.type)) {
98+
logger.debug(
99+
"ScriptEngine for language '{}' could not be found, skipping compilation of script for identifier: {}",
100+
type, engineIdentifier);
101+
return;
102+
}
96103
Optional<ScriptEngine> engine = getScriptEngine();
97104
if (engine.isPresent()) {
98105
ScriptEngine scriptEngine = engine.get();

0 commit comments

Comments
 (0)