Skip to content

Commit dcb33bf

Browse files
committed
fix: avoid returning nulls to prevent later NPE
Fixes #163
1 parent 8f5767b commit dcb33bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/com/flowingcode/vaadin/addons/gridexporter/BaseStreamResourceWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private String renderCellTextContent(Grid<T> grid, Column<T> column, String colu
162162
}
163163
}
164164

165-
return headerOrFooter;
165+
return headerOrFooter==null?"":headerOrFooter;
166166
}
167167

168168
protected Stream<T> obtainDataStream(DataProvider<T, ?> dataProvider) {

src/test/java/com/flowingcode/vaadin/addons/gridexporter/GridExporterMultipleHeaderRowsDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public GridExporterMultipleHeaderRowsDemo() throws EncryptedDocumentException, I
7474
@SuppressWarnings("null")
7575
BigDecimal total = people.stream().map(Person::getBudget).map(BigDecimal::valueOf)
7676
.reduce(BigDecimal.ZERO, BigDecimal::add);
77-
budgetColumn.setFooter(new DecimalFormat(NUMBER_FORMAT_PATTERN).format(total));
77+
// budgetColumn.setFooter(new DecimalFormat(NUMBER_FORMAT_PATTERN).format(total));
7878

7979
grid.setItems(people);
8080
grid.setWidthFull();

0 commit comments

Comments
 (0)