From 76a2cc3c1b1baedf9fa5af48ccbaa459c54f9b7f Mon Sep 17 00:00:00 2001 From: Kai Kreuzer Date: Mon, 28 Dec 2020 16:59:12 +0100 Subject: [PATCH] Correctly handle file extension when looking up script Signed-off-by: Kai Kreuzer --- .../org/openhab/core/model/script/actions/ScriptExecution.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/ScriptExecution.java b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/ScriptExecution.java index 665c1e657d8..c235db29b69 100644 --- a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/ScriptExecution.java +++ b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/ScriptExecution.java @@ -46,7 +46,7 @@ public static Object callScript(String scriptName) throws ScriptExecutionExcepti ModelRepository repo = ScriptServiceUtil.getModelRepository(); if (repo != null) { String scriptNameWithExt = scriptName; - if (scriptName.endsWith(Script.SCRIPT_FILEEXT)) { + if (!scriptName.endsWith(Script.SCRIPT_FILEEXT)) { scriptNameWithExt = scriptName + "." + Script.SCRIPT_FILEEXT; } XExpression expr = (XExpression) repo.getModel(scriptNameWithExt);