Commit 109d2b41 authored by juga's avatar juga
Browse files

Fix ZeroDivision by ensuring there're v3bw lines and total bw is > 0

parent 69de7db5
......@@ -51,7 +51,10 @@ def warn_if_not_accurate_enough(lines, constant):
def scale_lines(args, v3bw_lines):
assert len(v3bw_lines > 0)
total = sum([l.bw for l in v3bw_lines])
# In case total is zero, it will run on ZeroDivision
assert total > 0
if args.scale:
scale = len(v3bw_lines) * args.scale_constant
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment