Skip to content

Commit

Permalink
dirty fix required minutes division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne-Weber committed Jun 7, 2024
1 parent 9731bcc commit 54f889d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def total_remaining_minutes(self) -> int:

@cached_property
def progress(self) -> float:
return self.current_minutes / self.required_minutes
if self.required_minutes: # Quick fix to prevent division by zero crash
return self.current_minutes / self.required_minutes
else:
return "!!!required_minutes = 0 This could be due to a subscription requirement, tracked in Issue #101!!!"

def _on_claim(self) -> None:
result = super()._on_claim()
Expand Down

0 comments on commit 54f889d

Please sign in to comment.