From f6d7d5f584d7cce906ee81eb8376de5c22fb5377 Mon Sep 17 00:00:00 2001 From: mudrd8mz Date: Mon, 2 Mar 2009 21:51:25 +0000 Subject: [PATCH] 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 --- tag/locallib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tag/locallib.php b/tag/locallib.php index 71597baad3..aaa0283ba9 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(); -- 2.39.5