diff --git a/tag/locallib.php b/tag/locallib.php index 71597baad3c..aaa0283ba99 100644 --- a/tag/locallib.php +++ b/tag/locallib.php @@ -31,8 +31,10 @@ function tag_print_cloud($nr_of_tags=150, $return=false) { } $tagkeys = array_keys($tagsincloud); - $firsttagkey = $tagkeys[0]; - $maxcount = $tagsincloud[$firsttagkey]->count; + if (!empty($tagkeys)) { + $firsttagkey = $tagkeys[0]; + $maxcount = $tagsincloud[$firsttagkey]->count; + } $etags = array();