From b16f0342a3491887589f90e5dfa1bb937ed078bd Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 16 Oct 2003 04:17:53 +0000 Subject: [PATCH] Add a check in case no attendances are defined --- mod/attendance/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/attendance/lib.php b/mod/attendance/lib.php index 536643ea92..aeb5ed8b97 100755 --- a/mod/attendance/lib.php +++ b/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) { -- 2.39.5