summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/tag/helpers/tag_block.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 986584f0..1576ac08 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -26,12 +26,14 @@ class tag_block_Core {
$block->content = new View("tag_block.html");
$tags = tag::popular_tags(30)->as_array();
- $block->content->max_count = $tags[0]->count;
+ if ($tags) {
+ $block->content->max_count = $tags[0]->count;
- usort($tags, array("tag_block", "sort_by_name"));
- $block->content->tags = $tags;
+ usort($tags, array("tag_block", "sort_by_name"));
+ $block->content->tags = $tags;
- return $block;
+ return $block;
+ }
}
public static function sort_by_name($tag1, $tag2) {