Commit 4d99677f by Carsten Brandt

fixed div/0 issue in console progress bar

parent 60db9518
...@@ -861,7 +861,7 @@ class BaseConsole ...@@ -861,7 +861,7 @@ class BaseConsole
} }
$width -= mb_strlen($prefix); $width -= mb_strlen($prefix);
$percent = $done / $total; $percent = ($total == 0) ? 1 : $done / $total;
$info = sprintf("%d%% (%d/%d)", $percent * 100, $done, $total); $info = sprintf("%d%% (%d/%d)", $percent * 100, $done, $total);
if ($done > $total || $done == 0) { if ($done > $total || $done == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment