From 549c33729e32393f8225124a956cf0028e9fea1e Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Thu, 2 Sep 2021 13:30:11 +0000 Subject: [PATCH] FOP-3026: Fix NPE with empty table header git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1892815 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/table/RowPainter.java | 3 + .../standard-testcases/table_empty_header.xml | 69 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 fop/test/layoutengine/standard-testcases/table_empty_header.xml diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java index 06dda5efe..dbb1107ef 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java @@ -198,6 +198,9 @@ class RowPainter { * in the outer mode */ private void addAreasAndFlushRow(boolean lastInPart, boolean lastOnPage) { + if (currentRow == null) { + return; + } if (log.isDebugEnabled()) { log.debug("Remembering yoffset for row " + currentRow.getIndex() + ": " + currentRowOffset); diff --git a/fop/test/layoutengine/standard-testcases/table_empty_header.xml b/fop/test/layoutengine/standard-testcases/table_empty_header.xml new file mode 100644 index 000000000..e5954fdc6 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/table_empty_header.xml @@ -0,0 +1,69 @@ + + + + + +

+ This test checks basic tables. +

+
+ + false + + + + + + + + + + + + + + + + + + + D14 + + + + + + + + + D15 + + + + + + + + + + + + + + +
-- 2.39.5