Skip to content

Commit

Permalink
Prevent exception when adding 'teachername' element to site template (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Dec 27, 2018
1 parent c85d7e0 commit 61e18a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions element/teachername/classes/element.php
Expand Up @@ -102,6 +102,11 @@ public function render_html() {
protected function get_list_of_teachers() {
global $PAGE;

// Return early if we are in a site template.
if ($PAGE->context->id == \context_system::instance()->id) {
return [];
}

// The list of teachers to return.
$teachers = array();

Expand Down

0 comments on commit 61e18a6

Please sign in to comment.