Skip to content

Commit

Permalink
Fix division by zero (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Mar 3, 2022
1 parent 6a8f84e commit ef2ca75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/OMSimulatorServer/OMSimulatorServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ def run(self):
if self._pause:
time.sleep(0.3)
else:
progress = math.floor((time_-startTime) / (stopTime-startTime) * 100)
try:
progress = math.floor((time_-startTime) / (stopTime-startTime) * 100)
except ZeroDivisionError:
progress = 100

self.pub_msg('status', {'progress': progress})
if self._activeSignals:
results = {'time': time_}
Expand Down

0 comments on commit ef2ca75

Please sign in to comment.