Skip to content

Commit

Permalink
#2686 Fixed SandboxWrapFactory for executing scripts by Rhino - rever…
Browse files Browse the repository at this point in the history
…t ScriptExecutor; override toString for SandboxNativeJavaObject
  • Loading branch information
Limraj committed Sep 5, 2023
1 parent b8dd280 commit f72f2f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ public PointValueTime execute(String script,
if (o == null)
result = null;
else {
if (o instanceof NativeJavaObject) {
NativeJavaObject nativeJavaObject = (NativeJavaObject)o;
result = nativeJavaObject.getDefaultValue(String.class);
} else if (!(o instanceof AbstractPointWrapper)) {
if (!(o instanceof AbstractPointWrapper)) {
result = o.toString();
} else {
result = o;
Expand Down
4 changes: 4 additions & 0 deletions src/org/scada_lts/scripting/SandboxNativeJavaObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ public Object get(String methodName, Scriptable start) {
return NOT_FOUND;
}

@Override
public String toString() {
return String.valueOf(super.getDefaultValue(String.class));
}
}

0 comments on commit f72f2f6

Please sign in to comment.