| @@ -125,7 +125,7 @@ open class MailReminderService( | |||||
| for (team in teams) { | for (team in teams) { | ||||
| // if (team.id?.toInt() != 5) continue // remove this when finishes | // if (team.id?.toInt() != 5) continue // remove this when finishes | ||||
| val teamLead = team.staff | val teamLead = team.staff | ||||
| val teamMembers: List<Staff> = staffs.filter { it.team.id == team.id } | |||||
| val teamMembers: List<Staff> = staffs.filter { it.team != null && it.team.id == team.id } | |||||
| if (teamMembers.isEmpty()) continue | if (teamMembers.isEmpty()) continue | ||||
| val teamMembersIds: List<Long?> = teamMembers.map { it.id }.sorted() | val teamMembersIds: List<Long?> = teamMembers.map { it.id }.sorted() | ||||
| val filteredTimesheet = timesheet.filter { teamMembersIds.contains(it.staff?.id) } | val filteredTimesheet = timesheet.filter { teamMembersIds.contains(it.staff?.id) } | ||||
| @@ -191,7 +191,7 @@ open class MailReminderService( | |||||
| for (team in teams) { | for (team in teams) { | ||||
| // if (team.id?.toInt() != 5) continue // just for testing with fewer records, remove this when finishes | // if (team.id?.toInt() != 5) continue // just for testing with fewer records, remove this when finishes | ||||
| val teamLead = team.staff | val teamLead = team.staff | ||||
| val teamMembers: List<Staff> = staffs.filter { it.team.id == team.id } | |||||
| val teamMembers: List<Staff> = staffs.filter { it.team != null &&it.team.id == team.id } | |||||
| if (teamMembers.isEmpty()) continue | if (teamMembers.isEmpty()) continue | ||||
| val teamMembersIds: List<Long?> = teamMembers.map { it.id }.sorted() | val teamMembersIds: List<Long?> = teamMembers.map { it.id }.sorted() | ||||
| // getting the naughty list | // getting the naughty list | ||||