Fixes #14307: Fixed PHP warning when yii\console\UnknownCommandException is thrown for empty command

This commit is contained in:
Robert Korulczyk
2017-06-18 17:40:15 +02:00
committed by Alexander Makarov
parent 118aa0a581
commit 8d05e81bd4
3 changed files with 4 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class UnknownCommandException extends Exception
public function getSuggestedAlternatives()
{
$help = $this->application->createController('help');
if ($help === false) {
if ($help === false || $this->command === '') {
return [];
}
/** @var $helpController HelpController */