Bug 51836 - NullPointerException when navigation target doesn't exist
Summary: NullPointerException when navigation target doesn't exist
Status: RESOLVED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 1.0
Hardware: PC Windows XP
: P3 trivial
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 14:05 UTC by melanie.drake
Modified: 2012-04-07 04:08 UTC (History)
0 users



Attachments
IF file after modification (21.91 KB, text/xml)
2011-09-16 14:05 UTC, melanie.drake
Details
IF file before modification (147.44 KB, application/xml)
2011-09-16 14:05 UTC, melanie.drake
Details

Note You need to log in before you can comment on or make changes to this bug.
Description melanie.drake 2011-09-16 14:05:10 UTC
Created attachment 27512 [details]
IF file after modification

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
Comment 1 melanie.drake 2011-09-16 14:05:53 UTC
Created attachment 27513 [details]
IF file before modification
Comment 2 Glenn Adams 2012-04-07 01:42:22 UTC
resetting P2 open bugs to P3 pending further review