[ 
https://issues.apache.org/jira/browse/SLING-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Radu Cotescu reassigned SLING-6094:
-----------------------------------

    Assignee: Radu Cotescu

> HTL Parser NPE when using data-sly-attribute map and a static attribute with 
> colon
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-6094
>                 URL: https://issues.apache.org/jira/browse/SLING-6094
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.18
>            Reporter: Mark J. Becker
>            Assignee: Radu Cotescu
>             Fix For: Scripting HTL Java Compiler 1.0.2, Scripting HTL Engine 
> 1.0.22
>
>
> If you have a tag with an attribute name that has a colon and we use 
> data-sly-attribute with a map variance (value is a map), we get a NPE and a 
> cryptic stack trace.
> h3. sample.html
> {code}
> <div data-sly-use.logic="test.js">
>     ${logic.hello.hello}
>     <img src="" v-bind:src="abc" data-sly-attribute="${logic.hello}" />
> </div>
> {code}
> h3. test.js
> {code}
> use(function () {
>     var message = "Hello World";
>     return {
>         // anything exposed here can be used inside your template
>         hello: {hello: message}
>     };
> });
> {code}
> h3. Stack Trace
> {code}
> 04.10.2016 14:47:55.460 *ERROR* [0:0:0:0:0:0:0:1 [1475585275441] GET 
> /content/sample.html HTTP/1.1] 
> org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught 
> SlingException
> org.apache.sling.scripting.sightly.impl.compiler.CompilerException: 
> java.lang.NullPointerException
>       at 
> org.apache.sling.scripting.sightly.impl.compiler.SightlyJavaCompilerService.compileSource(SightlyJavaCompilerService.java:148)
>       at 
> org.apache.sling.scripting.sightly.impl.engine.UnitLoader.createUnit(UnitLoader.java:101)
>       at 
> org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.evaluateScript(SightlyScriptEngine.java:91)
>       at 
> org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.eval(SightlyScriptEngine.java:78)
>       at 
> org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
>       at 
> org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
> ... shortened
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to