Skip to content

Commit

Permalink
Protect TrickOps progres bar from divide by zero (#1664)
Browse files Browse the repository at this point in the history
Closes #1663

Co-authored-by: Dan Jordan <[email protected]>
  • Loading branch information
ddj116 and Dan Jordan authored Mar 8, 2024
1 parent 2ac342c commit e184db0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion share/trick/trickops/TrickWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,10 @@ def _connected_string(self):
self._sim_time(), self._average_speed())

def _connected_bar(self):
progress = self._tics.value / self._terminate_time.value
if self._terminate_time.value <= 0.0:
progress = 0.0
else:
progress = self._tics.value / self._terminate_time.value
return create_progress_bar(
progress, '{0:.1f}%'.format(100 * progress))

Expand Down

0 comments on commit e184db0

Please sign in to comment.