]> git.mjollnir.org Git - moodle.git/commitdiff
Add a check in case no attendances are defined
authormoodler <moodler>
Thu, 16 Oct 2003 04:17:53 +0000 (04:17 +0000)
committermoodler <moodler>
Thu, 16 Oct 2003 04:17:53 +0000 (04:17 +0000)
mod/attendance/lib.php

index 536643ea92d6f63d20b4c73804bc9b33b82fa50c..aeb5ed8b971bb2c83ef8c7af9df9f71d9674ee86 100755 (executable)
@@ -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) {