src/widgets/Tagcloud.js
branchnew-model
changeset 883 d35ad8111c5e
parent 882 61c384dda19e
child 906 4b6e154ae8de
--- a/src/widgets/Tagcloud.js	Thu May 03 17:52:52 2012 +0200
+++ b/src/widgets/Tagcloud.js	Fri May 04 16:56:41 2012 +0200
@@ -66,6 +66,9 @@
         })
         .first(this.tag_count)
         .value();
+    if (!_words.length) {
+        return;
+    }
     var _max = _words[0].count,
         _min = Math.min(_words[_words.length - 1].count, _max - 1),
         _scale = (this.max_font_size - this.min_font_size) / Math.sqrt(_max - _min);