fix none exception

This commit is contained in:
Lex Berezhny 2020-07-14 00:11:30 -04:00
parent 622a3b77ef
commit 9c5e2a8c8d

View file

@ -409,7 +409,7 @@ class Advanced(Basic):
diff = d['done'][0] - bar.n diff = d['done'][0] - bar.n
if main_bar_name != name: if main_bar_name != name:
main_bar = self.bars.get(main_bar_name) main_bar = self.bars.get(main_bar_name)
if main_bar.unit == bar.unit: if main_bar and main_bar.unit == bar.unit:
main_bar.update(diff) main_bar.update(diff)
bar.update(diff) bar.update(diff)
if d['done'][0] == -1 or d['done'][0] == bar.total: if d['done'][0] == -1 or d['done'][0] == bar.total: