Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-717

Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.6.2
    • 1.6.x, 1.7
    • Engine
    • None
    • Suse Linux

    Description

      The Engine throws an NPE if the IncludeEventHandler returns null.
      (using merge method with a list of macro libs)

      java.lang.NullPointerException
      >> at java.util.Hashtable.get(Hashtable.java:333)
      >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
      >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
      >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
      >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
      >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
      >> 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.directive.Parse.render(Parse.java:260)
      >> 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.Template.merge(Template.java:328)

      Attachments

        1. macros2.vm
          0.0 kB
          Jarkko Viinamäki
        2. test8.vm
          0.1 kB
          Jarkko Viinamäki
        3. Velocity717TestCase.java
          3 kB
          Jarkko Viinamäki

        Activity

          People

            Unassigned Unassigned
            zero1917 Johann Weber
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: