diff --git a/framework/console/Controller.php b/framework/console/Controller.php index d21d3adf21..0945ea5959 100644 --- a/framework/console/Controller.php +++ b/framework/console/Controller.php @@ -88,9 +88,11 @@ class Controller extends \yii\base\Controller $default = $this->$name; if (is_array($default)) { $this->$name = preg_split('/\s*,\s*/', $value); - } else { + } elseif ($default !== null) { settype($value, gettype($default)); $this->$name = $value; + } else { + $this->$name = $value; } $this->_passedOptions[] = $name; unset($params[$name]);