aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-11-20 10:20:29 +0000
committerJeremias Maerki <jeremias@apache.org>2007-11-20 10:20:29 +0000
commitce09ef5c0ca510811c2dd9df67ae4ad213a663c8 (patch)
treee5b4fb802bea59a106d7aba7294125d698fcf79b /src/java/org/apache/fop/area
parentadaeaeae7dd5ca1e5e3de8b5d88e496d5e733c93 (diff)
downloadxmlgraphics-fop-ce09ef5c0ca510811c2dd9df67ae4ad213a663c8.tar.gz
xmlgraphics-fop-ce09ef5c0ca510811c2dd9df67ae4ad213a663c8.zip
Bugzilla #43910:
Avoid a NullPointerException in AreaTreeHandler.endDocument(). Submitted by: David Delbecq <delbd.at.oma.be> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@596600 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r--src/java/org/apache/fop/area/AreaTreeHandler.java44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java
index be06aabfc..6eb2d738b 100644
--- a/src/java/org/apache/fop/area/AreaTreeHandler.java
+++ b/src/java/org/apache/fop/area/AreaTreeHandler.java
@@ -21,30 +21,27 @@ package org.apache.fop.area;
// Java
import java.io.OutputStream;
-import java.util.List;
import java.util.Iterator;
+import java.util.List;
-// XML
import org.xml.sax.SAXException;
-// Apache
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FormattingResults;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.extensions.ExtensionAttachment;
+import org.apache.fop.fo.extensions.destination.Destination;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.fo.pagination.bookmarks.BookmarkTree;
-import org.apache.fop.layoutmgr.PageSequenceLayoutManager;
import org.apache.fop.layoutmgr.LayoutManagerMaker;
import org.apache.fop.layoutmgr.LayoutManagerMapping;
-
-import org.apache.fop.area.DestinationData;
-import org.apache.fop.fo.extensions.destination.Destination;
+import org.apache.fop.layoutmgr.PageSequenceLayoutManager;
/**
* Area tree handler for formatting objects.
@@ -261,25 +258,26 @@ public class AreaTreeHandler extends FOEventHandler {
finishPrevPageSequence(null);
// process fox:destination elements
- List destinationList = rootFObj.getDestinationList();
- if (destinationList != null) {
- while (destinationList.size() > 0) {
- Destination destination = (Destination) destinationList.remove(0);
- DestinationData destinationData = new DestinationData(destination);
- addOffDocumentItem(destinationData);
+ if (rootFObj != null) {
+ List destinationList = rootFObj.getDestinationList();
+ if (destinationList != null) {
+ while (destinationList.size() > 0) {
+ Destination destination = (Destination) destinationList.remove(0);
+ DestinationData destinationData = new DestinationData(destination);
+ addOffDocumentItem(destinationData);
+ }
}
- }
- // process fo:bookmark-tree
- BookmarkTree bookmarkTree = rootFObj.getBookmarkTree();
- if (bookmarkTree != null) {
- BookmarkData data = new BookmarkData(bookmarkTree);
- addOffDocumentItem(data);
- if (!data.isResolved()) {
- // bookmarks did not fully resolve, add anyway. (hacky? yeah)
- model.handleOffDocumentItem(data);
+ // process fo:bookmark-tree
+ BookmarkTree bookmarkTree = rootFObj.getBookmarkTree();
+ if (bookmarkTree != null) {
+ BookmarkData data = new BookmarkData(bookmarkTree);
+ addOffDocumentItem(data);
+ if (!data.isResolved()) {
+ // bookmarks did not fully resolve, add anyway. (hacky? yeah)
+ model.handleOffDocumentItem(data);
+ }
}
}
-
model.endDocument();
if (statistics != null) {