From 416902097dad0051d3b2cda76de4e6c9683a3d0a Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Tue, 4 Feb 2014 19:38:01 -0500 Subject: [PATCH] Fix crash in nilmdb-fsck if there are zero intervals, etc. --- nilmdb/fsck/fsck.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nilmdb/fsck/fsck.py b/nilmdb/fsck/fsck.py index 3a507b5..f48200d 100644 --- a/nilmdb/fsck/fsck.py +++ b/nilmdb/fsck/fsck.py @@ -59,6 +59,8 @@ def retry_if_raised(exc, message = None, max_retries = 100): class Progress(object): def __init__(self, maxval): + if maxval == 0: + maxval = 1 self.bar = progressbar.ProgressBar( maxval = maxval, widgets = [ progressbar.Percentage(), ' ',