Justin Edelson created SLING-3052:
-------------------------------------
Summary: RhinoScriptEngine attemps to convert null objects from
Bindings to JS Object
Key: SLING-3052
URL: https://issues.apache.org/jira/browse/SLING-3052
Project: Sling
Issue Type: Bug
Components: Scripting
Affects Versions: Scripting JavaScript 2.0.12
Reporter: Justin Edelson
Fix For: Scripting JavaScript 2.0.14
Currently, RhinoScriptEngine iterates through the Bindings object and wraps
each object by calling `ScriptRuntime.toObject()`. This, however, fails when a
null binding is created with this stack trace:
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot convert null to
an object.
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
at
org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3356)
at
org.mozilla.javascript.ScriptRuntime.typeError0(ScriptRuntime.java:3362)
at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:908)
at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:872)
at
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine.setBoundProperties(RhinoJavaScriptEngine.java:186)
at
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine.eval(RhinoJavaScriptEngine.java:109)
at
org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira