From 26c2049147c488edb04bbd099ea65ef494a86c72 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 15 Jul 2020 20:56:59 +0000 Subject: [PATCH] [bug-64508] add guard for invalid v value git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879905 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xssf/usermodel/TestXSSFBugs.java | 14 ++++++++++++++ test-data/spreadsheet/64508.xlsx | Bin 0 -> 4304 bytes 2 files changed, 14 insertions(+) create mode 100644 test-data/spreadsheet/64508.xlsx 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 bb07ede477..873d7a0699 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -105,6 +105,7 @@ import org.apache.poi.xssf.model.CalculationChain; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.extensions.XSSFCellFill; import org.apache.xmlbeans.XmlException; +import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCalcCell; @@ -3546,4 +3547,17 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } } } + + @Test + public void testBug64508() throws IOException { + try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64508.xlsx")) { + int activeSheet = wb.getActiveSheetIndex(); + Sheet sheet1 = wb.getSheetAt(activeSheet); + Row row = sheet1.getRow(1); + CellReference aCellReference = new CellReference("E2"); + Cell aCell = row.getCell(aCellReference.getCol()); + Assert.assertEquals(CellType.STRING, aCell.getCellType()); + Assert.assertEquals("", aCell.getStringCellValue()); + } + } } diff --git a/test-data/spreadsheet/64508.xlsx b/test-data/spreadsheet/64508.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..090c6a246bed260e3c54de56363296ab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