Protect TrickOps progres bar from divide by zero (#1664)

Closes #1663

Co-authored-by: Dan Jordan <daniel.d.jordan@nasa.gov>
This commit is contained in:
ddj116 2024-03-08 10:10:55 -06:00 committed by GitHub
parent 2ac342cfc5
commit e184db0eb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1540,7 +1540,10 @@ class SingleRun(Job):
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))