MDL-17492 Do not try to access the first key of an empty array in case of no tag exists yet. Merged from 1.9 stable

This commit is contained in:
mudrd8mz 2009-03-02 21:51:25 +00:00
parent cef5304562
commit f6d7d5f584

View File

@ -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();