From b8f16c486a5cced199c2728edb6712f3aa3838db Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Tue, 12 Oct 2021 13:51:54 +0000 Subject: [PATCH] FOP-2943: NPE when inline character is a white space Thanks to J Frank git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1894164 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/fop/fo/FObj.java | 2 +- .../block-inline-empty-character.xml | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 fop/test/layoutengine/standard-testcases/block-inline-empty-character.xml diff --git a/fop-core/src/main/java/org/apache/fop/fo/FObj.java b/fop-core/src/main/java/org/apache/fop/fo/FObj.java index d938eded0..0f6acb871 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/FObj.java +++ b/fop-core/src/main/java/org/apache/fop/fo/FObj.java @@ -314,7 +314,7 @@ public abstract class FObj extends FONode implements Constants { } if (child == lastChild) { if (child.siblings != null) { - lastChild = siblings[0]; + lastChild = child.siblings[0]; } else { lastChild = null; } diff --git a/fop/test/layoutengine/standard-testcases/block-inline-empty-character.xml b/fop/test/layoutengine/standard-testcases/block-inline-empty-character.xml new file mode 100644 index 000000000..e39ec09a8 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/block-inline-empty-character.xml @@ -0,0 +1,45 @@ + + + + + +

This test checks empty character inside inline.

+
+ + + + + + + + + + block1 + block2 + + + + + + + + + + +
-- 2.39.5