Skip to content

Commit

Permalink
Correctly handle file extension when looking up script (openhab#2020)
Browse files Browse the repository at this point in the history
Fixes openhab#1990

Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer authored Dec 29, 2020
1 parent a91f8c6 commit 1c3e431
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c3e431

Please sign in to comment.