diff --git a/course/lib.php b/course/lib.php index af82da58a4a..e2003bc18a8 100644 --- a/course/lib.php +++ b/course/lib.php @@ -308,11 +308,13 @@ function print_recent_activity($course) { $changes[$changeinfo] = $change; } } - if (count($changes) > 0) { - print_headline(get_string("courseupdates").":"); - $content = true; - foreach ($changes as $changeinfo => $change) { - echo "

".$change["text"]."

"; + if (isset($changes)){ + if (count($changes) > 0) { + print_headline(get_string("courseupdates").":"); + $content = true; + foreach ($changes as $changeinfo => $change) { + echo "

".$change["text"]."

"; + } } } }