aboutsummaryrefslogtreecommitdiffstats
path: root/poi-examples
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-12-19 16:35:31 +0000
committerPJ Fanning <fanningpj@apache.org>2021-12-19 16:35:31 +0000
commite61dc89bff1f6dcc55672dda425425f2e62b3cfd (patch)
tree450bcb2e88298f2dff180a7b398e0cbfd23c14a0 /poi-examples
parent7d18ed02d151e01f955b290e715e148809a07c18 (diff)
downloadpoi-e61dc89bff1f6dcc55672dda425425f2e62b3cfd.tar.gz
poi-e61dc89bff1f6dcc55672dda425425f2e62b3cfd.zip
possible npes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896163 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples')
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xslf/BarChartDemo.java3
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java3
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xslf/DoughnutChartFromScratch.java3
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java3
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java3
5 files changed, 10 insertions, 5 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xslf/BarChartDemo.java b/poi-examples/src/main/java/org/apache/poi/examples/xslf/BarChartDemo.java
index 2c159fbb59..3a54f75ced 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xslf/BarChartDemo.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xslf/BarChartDemo.java
@@ -67,7 +67,8 @@ public final class BarChartDemo {
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
- String[] series = modelReader.readLine().split(",");
+ String seriesText = modelReader.readLine();
+ String[] series = seriesText == null ? new String[0] : seriesText.split(",");
// Category Axis Data
List<String> listLanguages = new ArrayList<>(10);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java b/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java
index bdfc3ea498..121b642a0c 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java
@@ -75,7 +75,8 @@ public final class ChartFromScratch {
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
- String[] series = modelReader.readLine().split(",");
+ String seriesText = modelReader.readLine();
+ String[] series = seriesText == null ? new String[0] : seriesText.split(",");
// Category Axis Data
List<String> listLanguages = new ArrayList<>(10);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xslf/DoughnutChartFromScratch.java b/poi-examples/src/main/java/org/apache/poi/examples/xslf/DoughnutChartFromScratch.java
index 77a438967f..dba07cedd9 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xslf/DoughnutChartFromScratch.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xslf/DoughnutChartFromScratch.java
@@ -73,7 +73,8 @@ public final class DoughnutChartFromScratch {
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
- String[] series = modelReader.readLine().split(",");
+ String seriesText = modelReader.readLine();
+ String[] series = seriesText == null ? new String[0] : seriesText.split(",");
// Category Axis Data
List<String> listLanguages = new ArrayList<>(10);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
index d26907c30e..df79c5199b 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
@@ -66,7 +66,8 @@ public final class BarChartExample {
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
- String[] series = modelReader.readLine().split(",");
+ String seriesText = modelReader.readLine();
+ String[] series = seriesText == null ? new String[0] : seriesText.split(",");
// Category Axis Data
List<String> listLanguages = new ArrayList<>(10);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
index 889ff30fb1..0625204699 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
@@ -70,7 +70,8 @@ public final class ChartFromScratch {
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
- String[] series = modelReader.readLine().split(",");
+ String seriesText = modelReader.readLine();
+ String[] series = seriesText == null ? new String[0] : seriesText.split(",");
// Category Axis Data
List<String> listLanguages = new ArrayList<>(10);