diff options
author | Jeremias Maerki <jeremias@apache.org> | 2009-04-16 09:07:23 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2009-04-16 09:07:23 +0000 |
commit | 721ef295c32495df02023a22d3c3de13ebb6697f (patch) | |
tree | a21b263ae9e1a3cbc41ab5cd77debe2910d1c66c /src/java/org/apache/fop/render/pdf | |
parent | 64ed5db8c1fe1132e693faa2fe74156c1f8aa64a (diff) | |
download | xmlgraphics-fop-721ef295c32495df02023a22d3c3de13ebb6697f.tar.gz xmlgraphics-fop-721ef295c32495df02023a22d3c3de13ebb6697f.zip |
Fixed a possible NPE when intermediate content is parsed and navigation elements are present.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@765524 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pdf')
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java b/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java index 2f2de2e62..2a9a07534 100644 --- a/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java @@ -25,6 +25,9 @@ import java.awt.geom.Rectangle2D; import java.util.Iterator; import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.apache.fop.pdf.PDFAction; import org.apache.fop.pdf.PDFDocument; import org.apache.fop.pdf.PDFFactory; @@ -42,9 +45,6 @@ import org.apache.fop.render.intermediate.extensions.NamedDestination; import org.apache.fop.render.intermediate.extensions.URIAction; import org.apache.fop.render.pdf.PDFDocumentHandler.PageReference; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Implementation of the {@link IFDocumentNavigationHandler} interface for PDF output. */ @@ -116,7 +116,7 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler if (pdfLink != null) { //accessibility: ptr has a value String ptr = link.getAction().getPtr(); - if (ptr.length() > 0) { + if (ptr != null && ptr.length() > 0) { this.documentHandler.addLinkToStructElem(ptr, pdfLink); int id = this.documentHandler.getPageLinkCountPlusPageParentKey(); pdfLink.setStructParent(id); |