debug-viewer: solved crash when maximum freq sentinel is 0

https://bugzilla.gnome.org/show_bug.cgi?id=794282
This commit is contained in:
Xabier Rodriguez Calvar 2018-03-13 13:48:00 +01:00 committed by Thibault Saunier
parent 70dcd99599
commit 8db603f8c8

View file

@ -725,7 +725,11 @@ class TimelineWidget (Gtk.DrawingArea):
if not data: if not data:
return return
heights = [height * float(d) / maximum for d in data] if maximum:
heights = [height * float(d) / maximum for d in data]
else:
heights = [0. for d in data]
ctx.move_to(0, height) ctx.move_to(0, height)
for i in range(len(heights)): for i in range(len(heights)):
ctx.line_to(i - .5, height - heights[i] + .5) ctx.line_to(i - .5, height - heights[i] + .5)