Skip to content

Commit 2821900

Browse files
Fixed possible division by zero error
1 parent 43fe593 commit 2821900

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/JobExecution.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getProgress(): int
133133

134134
public function getProgressAsPercent(int $precision = 1): float
135135
{
136-
return round($this->current_progress / $this->progress_max * 100, $precision);
136+
return $this->progress_max <= 0 ? 0.00 : round($this->current_progress / $this->progress_max * 100, $precision);
137137
}
138138

139139
public function logEmergency(string $message, array $context = []): JobExecutionLogContract

0 commit comments

Comments
 (0)