From ddb70d8c170957d0fbf0dd6fcd42a1662a819615 Mon Sep 17 00:00:00 2001 From: Melanie Treitinger <66598405+melanietreitinger@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:17:04 +0100 Subject: [PATCH] Add check if process exists. (#191) This prevents courses to be processed which had been rescued by the teacher. --- step/email/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/step/email/lib.php b/step/email/lib.php index cb1e4db1..8ade151c 100644 --- a/step/email/lib.php +++ b/step/email/lib.php @@ -88,7 +88,7 @@ public function process_course($processid, $instanceid, $course) { public function process_waiting_course($processid, $instanceid, $course) { // When time runs up and no one wants to keep the course, then proceed. $process = process_manager::get_process_by_id($processid); - if ($process->timestepchanged < time() - settings_manager::get_settings( + if (null !== $process && $process->timestepchanged < time() - settings_manager::get_settings( $instanceid, settings_type::STEP )['responsetimeout']) {