From 4d99677f079a816f0e1d1ed1d1db7f1126b44340 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 5 Jan 2014 22:13:45 +0100 Subject: [PATCH] fixed div/0 issue in console progress bar --- framework/yii/helpers/BaseConsole.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/helpers/BaseConsole.php b/framework/yii/helpers/BaseConsole.php index c78ed67..307fb00 100644 --- a/framework/yii/helpers/BaseConsole.php +++ b/framework/yii/helpers/BaseConsole.php @@ -861,7 +861,7 @@ class BaseConsole } $width -= mb_strlen($prefix); - $percent = $done / $total; + $percent = ($total == 0) ? 1 : $done / $total; $info = sprintf("%d%% (%d/%d)", $percent * 100, $done, $total); if ($done > $total || $done == 0) {