diff --git a/classes/studyitem.php b/classes/studyitem.php index 59bb4e0..07d44a8 100644 --- a/classes/studyitem.php +++ b/classes/studyitem.php @@ -569,7 +569,9 @@ class studyitem { // Add course if available. if (courseinfo::exists($this->r->course_id)) { $cinfo = $this->getcourseinfo(); - $model['course'] = $cinfo->user_model($userid); + if (is_object($cinfo)) { + $model['course'] = $cinfo->user_model($userid); + } } // Add incoming and outgoing connection info. @@ -608,7 +610,11 @@ class studyitem { if (strtolower($this->r->type) == 'course') { // Determine competency by competency completion. $courseinfo = $this->getcourseinfo(); - return $this->aggregator->aggregate_course($courseinfo, $this, $userid); + if (is_object($courseinfo)) { + return $this->aggregator->aggregate_course($courseinfo, $this, $userid); + } else { + return completion::INCOMPLETE; + } } else if (strtolower($this->r->type) == 'start') { // Does not need to use aggregator. // Either true, or the completion of the reference.