From 3665391f8bbf40aa27acc816dc546237461e1cba Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 21 Jan 2010 21:29:42 -0800 Subject: Guard against division by zero. --- modules/tag/helpers/tag.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index d895e08f..c49a2d0f 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -73,6 +73,9 @@ class tag_Core { if ($tags) { $cloud = new View("tag_cloud.html"); $cloud->max_count = $tags[0]->count; + if (!$cloud->max_count) { + return; + } usort($tags, array("tag", "sort_by_name")); $cloud->tags = $tags; return $cloud; -- cgit v1.2.3