Skip to content

Commit

Permalink
[Fix kbss-cvut/record-manager-ui#185] Avoid adding null numbers to ex…
Browse files Browse the repository at this point in the history
…cel as it throws NullPointerException
  • Loading branch information
kostobog committed Jul 17, 2024
1 parent ec8c012 commit 3f95c9a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void addDataToExcel(XSSFWorkbook workbook, List<ExportRecord> data) thro
r.createCell(10).setCellValue(rec.getFuselage());
r.createCell(11).setCellValue(rec.getFailDate());
r.createCell(12).setCellValue(rec.getFlightHours());
r.createCell(13).setCellValue(rec.getNumberOfAirframeOverhauls());
Optional.ofNullable(rec.getNumberOfAirframeOverhauls()).ifPresent( i -> r.createCell(13).setCellValue(i));
r.createCell(14).setCellValue(rec.getClassificationOfOccurrence());
r.createCell(15).setCellValue(rec.getFailureAscertainmentCircumstances());
r.createCell(16).setCellValue(rec.getRepeatedFailure());
Expand All @@ -136,7 +136,7 @@ private void addDataToExcel(XSSFWorkbook workbook, List<ExportRecord> data) thro
r.createCell(19).setCellValue(rec.getMission());
r.createCell(20).setCellValue(rec.getRepair());
r.createCell(21).setCellValue(rec.getRepairDuration());
r.createCell(22).setCellValue(rec.getAverageNumberOfMenDuringRepairment());
Optional.ofNullable(rec.getAverageNumberOfMenDuringRepairment()).ifPresent( i -> r.createCell(22).setCellValue(i));
r.createCell(23).setCellValue(rec.getFailureDescription());
r.createCell(24).setCellValue(rec.getDescriptionOfCorrectiveAction());
r.createCell(25).setCellValue(rec.getAc_compName());
Expand Down

0 comments on commit 3f95c9a

Please sign in to comment.