Skip to content
Snippets Groups Projects
Commit c6d695c1 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

small NPE fixed when accessing data from excel

parent ab6b12b3
No related branches found
No related tags found
1 merge request!1Appointments dev
...@@ -62,7 +62,7 @@ public class XlsxCalendarProcessor { ...@@ -62,7 +62,7 @@ public class XlsxCalendarProcessor {
CellParser parser = new CellParser(); CellParser parser = new CellParser();
parser.setSubjectDao(subjectDao); parser.setSubjectDao(subjectDao);
for (int weekOffset : weekStartRows) { for (int weekOffset : weekStartRows) {
Row weekRow = sheet.getRow(weekOffset + dayOfMonthRowOffset); Row weekRow = sheet.getRow(weekOffset + dayOfMonthRowOffset);
for (int dayColumnOffset : dayColumns) { for (int dayColumnOffset : dayColumns) {
...@@ -89,13 +89,16 @@ public class XlsxCalendarProcessor { ...@@ -89,13 +89,16 @@ public class XlsxCalendarProcessor {
} }
} }
String query = hourRow.getCell(dayColumnOffset).getStringCellValue(); Cell queryCell = hourRow.getCell(dayColumnOffset);
if (queryCell != null) {
String query = queryCell.getStringCellValue();
if (query != null && !query.isEmpty()) {
AppointmentEntry entry = parser.parseAppointment(query, hour);
entry.setDay(day);
if (query != null && !query.isEmpty()) { result.add(entry);
AppointmentEntry entry = parser.parseAppointment(query, hour); }
entry.setDay(day);
result.add(entry);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment