mirror of https://github.com/apache/poi.git
[bug-65227] add NPE guard in SheetUtil. Thanks to Petr Blaha
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888553 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
30d8d17735
commit
0c3aa44d36
|
@ -160,6 +160,7 @@ public class SheetUtil {
|
||||||
double width = -1;
|
double width = -1;
|
||||||
if (cellType == CellType.STRING) {
|
if (cellType == CellType.STRING) {
|
||||||
RichTextString rt = cell.getRichStringCellValue();
|
RichTextString rt = cell.getRichStringCellValue();
|
||||||
|
if (rt != null && rt.getString() != null) {
|
||||||
String[] lines = rt.getString().split("\\n");
|
String[] lines = rt.getString().split("\\n");
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
String txt = line + defaultChar;
|
String txt = line + defaultChar;
|
||||||
|
@ -173,6 +174,7 @@ public class SheetUtil {
|
||||||
|
|
||||||
width = getCellWidth(defaultCharWidth, colspan, style, width, str);
|
width = getCellWidth(defaultCharWidth, colspan, style, width, str);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
String sval = null;
|
String sval = null;
|
||||||
if (cellType == CellType.NUMERIC) {
|
if (cellType == CellType.NUMERIC) {
|
||||||
|
|
Loading…
Reference in New Issue