Skip to content

Commit

Permalink
Fix division by zero (#2369)
Browse files Browse the repository at this point in the history
  • Loading branch information
puzzledsab committed Dec 10, 2022
1 parent 6a80869 commit 5cd5f00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sabnzbd/nzbqueue.py
Expand Up @@ -585,7 +585,7 @@ def sort_queue(self, field: str, direction: Optional[str] = None):
sort_function = lambda nzo: nzo.avg_date
elif field == "remaining":
logging.debug("Sorting by percentage downloaded...")
sort_function = lambda nzo: nzo.remaining / nzo.bytes
sort_function = lambda nzo: nzo.remaining / nzo.bytes if nzo.bytes else 1
else:
logging.debug("Sort: %s not recognized", field)
return
Expand Down

0 comments on commit 5cd5f00

Please sign in to comment.