Fop
  1. Fop
  2. FOP-1968

NullPointerException when navigation target doesn't exist

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: general
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      51836

      Description

      A NullPointerException was encountered when trying to generate a PDF from a modified FOP IF file. The IF file was systematically manipulated to delete some of the <page-sequence> and <page> elements. The exception was the result of <nav:> elements that reference content that no longer exists in the IF file. Stripping all <nav:> elements from the IF file avoids the exception. There may be a more graceful way of handling this than a NullPointerException.

      The specific error I get when trying to generate the PDF is:
      Caused by: java.lang.NullPointerException
      at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.updateTargetLocation(PDFDocumentNavigationHandler.java:188)
      at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.getAction(PDFDocumentNavigationHandler.java:160)
      at org.apache.fop.render.pdf.PDFDocumentNavigationHandler.renderLink(PDFDocumentNavigationHandler.java:108)
      at org.apache.fop.render.intermediate.extensions.DocumentNavigationHandler.endElement(DocumentNavigationHandler.java:186)
      [rest of stack omitted]

      I believe the NullPointerException occurs on this line in PDFDocumentNavigationHandler.java:
      action.getTargetLocation().x / 1000.0

      1. postmod.if.xml
        22 kB
        melanie.drake
      2. premod.if.xml
        147 kB
        melanie.drake

        Activity

        Show
        Glenn Adams added a comment - http://svn.apache.org/viewvc?view=revision&revision=1310666
        Hide
        Glenn Adams added a comment -

        resetting P2 open bugs to P3 pending further review

        Show
        Glenn Adams added a comment - resetting P2 open bugs to P3 pending further review
        Hide
        melanie.drake added a comment -

        Attachment premod.if.xml has been added with description: IF file before modification

        Show
        melanie.drake added a comment - Attachment premod.if.xml has been added with description: IF file before modification
        Hide
        melanie.drake added a comment -

        Attachment postmod.if.xml has been added with description: IF file after modification

        Show
        melanie.drake added a comment - Attachment postmod.if.xml has been added with description: IF file after modification

          People

          • Assignee:
            fop-dev
            Reporter:
            melanie.drake
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development