Skip to content

Commit

Permalink
MDL-8455 - unslightly error if no course category
Browse files Browse the repository at this point in the history
  • Loading branch information
poltawski committed Mar 14, 2007
1 parent 521a96d commit d8572e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ function print_courses($category, $hidesitecourse = false) {

if (empty($category)) {
$categories = get_categories(0); // Parent = 0 ie top-level categories only
if (count($categories) == 1) {
if ($categories != null and count($categories) == 1) {
$category = array_shift($categories);
$courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.category,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.teacher,c.cost,c.currency,c.enrol,c.guest');
} else {
Expand Down

0 comments on commit d8572e7

Please sign in to comment.