Author: fanningpj Date: Tue Oct 24 09:34:58 2023 New Revision: 1913258 URL: http://svn.apache.org/viewvc?rev=1913258&view=rev Log: [bug-67778] add more null checks to BaseXSSFFormulaEvaluator
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java?rev=1913258&r1=1913257&r2=1913258&view=diff ============================================================================== --- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java (original) +++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java Tue Oct 24 09:34:58 2023 @@ -143,13 +143,18 @@ public abstract class BaseXSSFFormulaEva 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); + } + } } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org