diff --git a/code/widgets/BlogTagsCloudWidget.php b/code/widgets/BlogTagsCloudWidget.php index 550e9f3..7f81e3e 100644 --- a/code/widgets/BlogTagsCloudWidget.php +++ b/code/widgets/BlogTagsCloudWidget.php @@ -90,12 +90,15 @@ class BlogTagsCloudWidget extends Widget } // normalize the tag counts from 1 to 10 - $tagfactor = 10 / $maxTagCount; - foreach ($tags->getIterator() as $tag) { - $normalized = round($tagfactor * ($tag->TagCount)); - $tag->NormalizedTag = $normalized; + if ($maxTagCount) { + $tagfactor = 10 / $maxTagCount; + foreach ($tags->getIterator() as $tag) { + $normalized = round($tagfactor * ($tag->TagCount)); + $tag->NormalizedTag = $normalized; + } } + return $tags; }