[
https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarkko Viinamäki updated VELOCITY-728:
--------------------------------------
Attachment: velocity-728.patch
This should fix it.
If #parse doesn't get an argument, a VelocityException is thrown with
information where the problem occurs.
The previous code didn't obviously work and instead of throwing exceptions it
just wrote things to Velocity log. This same problem is related to other
directives as well (no checking whether we actually got the argument or not and
no exception in case of error).
> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
> Key: VELOCITY-728
> URL: https://issues.apache.org/jira/browse/VELOCITY-728
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Reporter: Siri C.
> Attachments: velocity-728.patch
>
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> at
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> at
> org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277)
> at
> org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> at
> org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> ... 6 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]