Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-1968

NullPointerException when navigation target doesn't exist

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: unqualified
    • 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

        Attachments

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

          Activity

            People

            • Assignee:
              fop-dev@xmlgraphics.apache.org fop-dev
              Reporter:
              melanie.drake@gmail.com melanie.drake
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: