diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 40cb33fae..3d9d69297 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -588,4 +588,18 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { assertEquals("A9", cc.getCTCalcChain().getCArray(2).getR()); } + + public void test49156() throws Exception { + Workbook wb = XSSFTestDataSamples.openSampleWorkbook("49156.xlsx"); + FormulaEvaluator formulaEvaluator = wb.getCreationHelper().createFormulaEvaluator(); + + Sheet sheet = wb.getSheetAt(0); + for(Row row : sheet){ + for(Cell cell : row){ + if(cell.getCellType() == Cell.CELL_TYPE_FORMULA){ + formulaEvaluator.evaluateInCell(cell); // caused NPE on some cells + } + } + } + } } diff --git a/test-data/spreadsheet/49156.xlsx b/test-data/spreadsheet/49156.xlsx new file mode 100644 index 000000000..ca41dc6bb Binary files /dev/null and b/test-data/spreadsheet/49156.xlsx differ