Uploaded image for project: 'Apache Freemarker'
  1. Apache Freemarker
  2. FREEMARKER-165

NullPointerException (at freemarker.core.BlockAssignment.accept:62)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.28
    • 2.3.31
    • engine
    • None
    • Windows 10; fmpp / http://fmpp.sourceforge.net/ (v0.9.16 per March, 10th 2020)

    Description

      Have a xxx.ftl with only this content:
      <#assign VersionMajor in doc>1</#assign>
       
      Try to processing this with fmpp results in this error message:

      • Executing: xxx.ftl
        !!! FAILED

      >>> ABORTED! <<<

      0 executed + 0 rendered + 0 copied = 0 successfully processed
      1 failed, 0 warning(s)
      Time elapsed: 0.077 seconds

      Error when processing this file: xxx.ftl
      java.lang.NullPointerException (at freemarker.core.BlockAssignment.accept:62)

      The reason is the assignment of the variable, expected to be defined in another (not yet included template). Remove the text marked as red and it succeeds.

      Expected: not an NPE, but a useful error message pointing to the problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            torstenr Torsten Rendelmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: