From d1b862c95d7c6c9236b0effa6867a324b31e9c07 Mon Sep 17 00:00:00 2001 From: christian Date: Tue, 10 Oct 2023 17:37:06 -0500 Subject: [PATCH] Exercise: Fix error when object link is null - refs BT#21109 --- public/main/exercise/exercise.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index 81fa594fa2..157c1cf04a 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -6537,7 +6537,7 @@ class Exercise $course = api_get_course_entity($this->course_id); $link = $exercise->getFirstResourceLinkFromCourseSession($course); - if ($link->isDraft()) { + if ($link && $link->isDraft()) { $this->active = 0; }