From 77ddd87605219b76cb69cc5c4897e49c3b8be9be Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 6 Jul 2020 13:37:10 +0000 Subject: [PATCH] SXSSFSheet: beware of null _writer git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879551 13f79535-47bb-0310-9956-ffa450edef68 --- build.gradle | 1 + src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b8628215e3..ae2a3916ef 100644 --- a/build.gradle +++ b/build.gradle @@ -127,6 +127,7 @@ subprojects { exclude '**/BaseTestCellUtil.class' exclude '**/TestUnfixedBugs.class' exclude '**/TestOneFile.class' + include '**/TestDeferredSXSSFWorkbook.class' // Exclude Test Suites exclude '**/All*Tests.class' diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 64f24ddcc1..debb2c45e0 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -1880,7 +1880,7 @@ public class SXSSFSheet implements Sheet SXSSFRow row = _rows.get(firstRowNum); // Update the best fit column widths for auto-sizing just before the rows are flushed _autoSizeColumnTracker.updateColumnWidths(row); - _writer.writeRow(rowIndex, row); + if (_writer != null) _writer.writeRow(rowIndex, row); _rows.remove(firstRowNum); lastFlushedRowNumber = rowIndex; } -- 2.39.5