From 721ef295c32495df02023a22d3c3de13ebb6697f Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 16 Apr 2009 09:07:23 +0000 Subject: 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 --- .../org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java | 8 ++++---- 1 file 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); -- cgit v1.2.3