diff --git a/blocks/community/locallib.php b/blocks/community/locallib.php index b2ec8ab5a5c..bbfc9894572 100644 --- a/blocks/community/locallib.php +++ b/blocks/community/locallib.php @@ -38,6 +38,7 @@ class block_community_manager { $community = $this->block_community_get_course($course->url, $userid); if (empty($community)) { + $community = new stdClass(); $community->userid = $userid; $community->coursename = $course->name; $community->coursedescription = $course->description;