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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 3a69605f4c [bz-69905] check cell before recursing (#978)
3a69605f4c is described below

commit 3a69605f4cce80865895f73e15f1d0a1ac72a153
Author: PJ Fanning <[email protected]>
AuthorDate: Wed Dec 17 21:29:03 2025 +0100

    [bz-69905] check cell before recursing (#978)
---
 poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java 
b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java
index d23375fda5..a9062ff7bf 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java
@@ -410,7 +410,9 @@ public final class XSSFCell extends CellBase {
             /* In an excel generated array formula, the formula property might 
be set, but the string is empty in related cells */
             if (f == null || f.getStringValue().isEmpty()) {
                 XSSFCell cell = getSheet().getFirstCellInArrayFormula(this);
-                return cell.getCellFormula(fpb);
+                if (cell != this) {
+                    return cell.getCellFormula(fpb);
+                }
             }
         }
         if (f == null) {


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

Reply via email to