Skip to content

Commit

Permalink
make code more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
boal committed Nov 7, 2024
1 parent 6d4fda4 commit a12b211
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
Expand Down Expand Up @@ -40,14 +42,18 @@ public byte[] createFile(final Map<Integer, List<AuswertungMessquerschnitte>> au
dataCellStyle.setWrapText(true);

// Füge Daten zum Document hinzu.
auswertungenByMstId.forEach((mstId, tagesaggregatResponseDtos) -> {
MapUtils.emptyIfNull(auswertungenByMstId).forEach((mstId, tagesaggregatResponseDtos) -> {

final Sheet sheet = spreadsheetDocument.createSheet(String.format("Messstelle %s", mstId));

addMetaHeaderToSheet(sheet);
addMetaDataToSheet(sheet, options);
addDataHeaderToSheet(sheet, options.getFahrzeuge());
addDataToSheet(sheet, dataCellStyle, tagesaggregatResponseDtos, options.getFahrzeuge());
addDataToSheet(
sheet,
dataCellStyle,
ListUtils.emptyIfNull(tagesaggregatResponseDtos),
options.getFahrzeuge());

});

Expand Down

0 comments on commit a12b211

Please sign in to comment.