This is an automated email from the ASF dual-hosted git repository.

centic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git

commit 1594baf696fe2528c4cbffa9a2f8c9371cdf0b20
Author: Dominik Stadler <[email protected]>
AuthorDate: Thu Feb 19 20:28:20 2026 +0100

    Avoid NPE when updating cell-anchors
---
 .../java/org/apache/poi/xslf/usermodel/XSLFTable.java  |   8 ++++++++
 test-data/slideshow/LIBRE_OFFICE-100610-0.pptx         | Bin 0 -> 743904 bytes
 2 files changed, 8 insertions(+)

diff --git 
a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTable.java 
b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTable.java
index eeb48af8a7..4d0e79afd9 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTable.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTable.java
@@ -427,6 +427,10 @@ public class XSLFTable extends XSLFGraphicFrame implements 
Iterable<XSLFTableRow
                 for (int col2=col+1; col2<col+tc.getGridSpan(); col2++) {
                     assert(col2 < cols);
                     XSLFTableCell tc2 = getCell(row, col2);
+                    if (tc2 == null) {
+                        LOG.warn("unavailable table span - rendering result is 
probably wrong");
+                        continue;
+                    }
                     if (tc2.getGridSpan() != 1 || tc2.getRowSpan() != 1) {
                         LOG.warn("invalid table span - rendering result is 
probably wrong");
                     }
@@ -435,6 +439,10 @@ public class XSLFTable extends XSLFGraphicFrame implements 
Iterable<XSLFTableRow
                 for (int row2=row+1; row2<row+tc.getRowSpan(); row2++) {
                     assert(row2 < rows);
                     XSLFTableCell tc2 = getCell(row2, col);
+                    if (tc2 == null) {
+                        LOG.warn("unavailable table span - rendering result is 
probably wrong");
+                        continue;
+                    }
                     if (tc2.getGridSpan() != 1 || tc2.getRowSpan() != 1) {
                         LOG.warn("invalid table span - rendering result is 
probably wrong");
                     }
diff --git a/test-data/slideshow/LIBRE_OFFICE-100610-0.pptx 
b/test-data/slideshow/LIBRE_OFFICE-100610-0.pptx
new file mode 100755
index 0000000000..e6203e1975
Binary files /dev/null and b/test-data/slideshow/LIBRE_OFFICE-100610-0.pptx 
differ


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to