68fc739
From 80f97fb3bbb92a3a85589cec7387dec953044853 Mon Sep 17 00:00:00 2001
68fc739
From: Michael Kuhn <suraia@ikkoku.de>
68fc739
Date: Fri, 19 Feb 2016 20:11:13 +0100
68fc739
Subject: [PATCH] Fix division by zero (#245).
68fc739
68fc739
---
68fc739
 src/hamster/overview.py | 2 +-
68fc739
 1 file changed, 1 insertion(+), 1 deletion(-)
68fc739
68fc739
diff --git a/src/hamster/overview.py b/src/hamster/overview.py
68fc739
index 02a6ab3..ca895fb 100755
68fc739
--- a/src/hamster/overview.py
68fc739
+++ b/src/hamster/overview.py
68fc739
@@ -132,7 +132,7 @@ def __init__(self, width=0, height=0, vertical=None, **kwargs):
68fc739
     def set_items(self, items):
68fc739
         """expects a list of key, value to work with"""
68fc739
         res = []
68fc739
-        max_value = sum((rec[1] for rec in items))
68fc739
+        max_value = max(sum((rec[1] for rec in items)), 1)
68fc739
         for key, val in items:
68fc739
             res.append((key, val, val * 1.0 / max_value))
68fc739
         self._items = res