[bug-67778] add more null checks to BaseXSSFFormulaEvaluator

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913258 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2023-10-24 09:34:58 +00:00
parent 8759103c94
commit 176a685e2d
1 changed files with 12 additions and 7 deletions

View File

@ -143,13 +143,18 @@ public abstract class BaseXSSFFormulaEvaluator extends BaseFormulaEvaluator {
int lastRow = area3DPxg.getLastRow();
for (int rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {
XSSFRow row = sheet.getRow(rowIndex);
int firstColumn = area3DPxg.getFirstColumn();
int lastColumn = area3DPxg.getLastColumn();
for (int cellIndex = firstColumn; cellIndex <= lastColumn; cellIndex++) {
XSSFCell cell = row.getCell(cellIndex);
String cellValue = cell.getRawValue();
String cellR = new CellReference(cell).formatAsString(false);
externalLinksTable.cacheData(sheet.getSheetName(), (long)rowIndex + 1, cellR, cellValue);
if (row != null) {
int firstColumn = area3DPxg.getFirstColumn();
int lastColumn = area3DPxg.getLastColumn();
for (int cellIndex = firstColumn; cellIndex <= lastColumn; cellIndex++) {
XSSFCell cell = row.getCell(cellIndex);
if (cell != null) {
String cellValue = cell.getRawValue();
String cellR = new CellReference(cell).formatAsString(false);
externalLinksTable.cacheData(sheet.getSheetName(),
(long)rowIndex + 1, cellR, cellValue);
}
}
}
}
}