diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-21 21:29:42 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-21 21:29:42 -0800 |
commit | 3665391f8bbf40aa27acc816dc546237461e1cba (patch) | |
tree | 3a8c90e5e3d4fce914d992b8624f24ece61db1e4 | |
parent | 318c86ab56ec63f2f65af0581991c7a5dc8ae433 (diff) |
Guard against division by zero.
-rw-r--r-- | modules/tag/helpers/tag.php | 3 |
1 files changed, 3 insertions, 0 deletions
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; |