Skip to content

Commit

Permalink
Only update bar.total when bar is instantiated
Browse files Browse the repository at this point in the history
The `self.bar.total = total` is called even when `self.bar` is not instantiated.  This results in crash.
  • Loading branch information
gongzhitaao authored and gauteh committed Sep 7, 2024
1 parent eb5ff8a commit ff929b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lieer/gmailieer.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ def full_pull(self):
previous = self.load_resume(resume_file, last_id)

for total, gids in self.remote.all_messages():
self.bar.total = total
if not self.args.quiet and self.bar:
self.bar.total = total
self.bar_update(len(gids))

message_gids.extend(m["id"] for m in gids)
Expand Down

0 comments on commit ff929b7

Please sign in to comment.