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

NullPointerException in Foreach.java - PatchAvailable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.7
    • Engine
    • None

    Description

      I checked out the code from http://svn.apache.org/repos/asf/velocity/engine/trunk/ I think this is version 1.6.x because it is listed on http://velocity.apache.org/download.cgi But I'm not sure.

      When I was playing with the Velocity Template Engine I got a NullPointerException. Maybe it is because of my unusual configuration that this exception didn't occured before to others. But in my opinion this kind of Exceptions may never occur.

      To be specific, the Exception is thrown on line 225 in Foreach.java
      if (!hasNextName.equals("velocityHasNext"))
      When the variable hasNextName equals null
      hasNextName is a deprecated config setting. It is assigned on line 210: hasNextName = rsvc.getString(RuntimeConstants.HAS_NEXT_NAME);

      The included patch makes it NullPointer save: if (!"velocityHasNext".equals(hasNextName))

      Attachments

        Activity

          People

            Unassigned Unassigned
            rachidbm Rachid
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: