[GtkUI] Fix ZeroDivisionError in piecesbar

While waiting for metadata for a magnet, self.__num_pieces is zero.
This commit is contained in:
Giorgos Retsinas 2016-10-03 14:49:02 +03:00 committed by Calum Lind
parent db1b427b3f
commit 6b630c9fd2
1 changed files with 3 additions and 3 deletions

View File

@ -73,12 +73,12 @@ class PiecesBar(gtk.DrawingArea):
# Restrict Cairo to the exposed area; avoid extra work # Restrict Cairo to the exposed area; avoid extra work
self.__roundcorners_clipping() self.__roundcorners_clipping()
if not self.__pieces and self.__num_pieces is not None: if self.__pieces:
self.__draw_pieces()
elif self.__num_pieces:
# Special case. Completed torrents do not send any pieces in their # Special case. Completed torrents do not send any pieces in their
# status. # status.
self.__draw_pieces_completed() self.__draw_pieces_completed()
elif self.__pieces:
self.__draw_pieces()
self.__draw_progress_overlay() self.__draw_progress_overlay()
self.__write_text() self.__write_text()