Permalink
Browse files

Add a check in case no attendances are defined

  • Loading branch information...
1 parent 6f27717 commit b16f0342a3491887589f90e5dfa1bb937ed078bd moodler committed Oct 16, 2003
Showing with 3 additions and 1 deletion.
  1. +3 −1 mod/attendance/lib.php
View
4 mod/attendance/lib.php
@@ -264,7 +264,9 @@ function attendance_cron () {
global $CFG;
echo "Attendance: Performing automatic attendance logging\n";
// look for all attendance instances set to autoattend
- $attendances = get_records("attendance", "autoattend", 1, "course ASC");
+ if (!$attendances = get_records("attendance", "autoattend", 1, "course ASC")) {
+ return true;
+ }
$td = attendance_find_today(time());
$tm = attendance_find_tomorrow(time());
foreach($attendances as $attendance) {

0 comments on commit b16f034

Please sign in to comment.