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; }