From 502193eb24a03b50ed24f4d8b76369afc4e786eb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Nov 2015 15:33:03 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tag_browser/model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tag_browser/model.py b/src/calibre/gui2/tag_browser/model.py index a95f1f77f7..41852688c2 100644 --- a/src/calibre/gui2/tag_browser/model.py +++ b/src/calibre/gui2/tag_browser/model.py @@ -113,7 +113,10 @@ class TagTreeItem(object): # {{{ if self.tag.avg_rating: total += 1 num += self.tag.avg_rating - return num/float(total) + try: + return num/float(total) + except ZeroDivisionError: + return 0 def data(self, role): if role == Qt.UserRole: