diff --git a/src/Shell/HelpShell.php b/src/Shell/HelpShell.php index 10a5a669373..10a195de864 100644 --- a/src/Shell/HelpShell.php +++ b/src/Shell/HelpShell.php @@ -25,6 +25,11 @@ */ class HelpShell extends Shell { + /** + * The command collection to get help on. + * + * @var \Cake\Console\CommandCollection + */ protected $commands; /** @@ -69,12 +74,12 @@ public function main() if (!$this->commands) { $this->err('Could not print command list, no CommandCollection was set using setCommandCollection()'); + return; } if ($this->param('xml')) { - $this->asXml($this->commands); - return; + return $this->asXml($this->commands); } $this->asText($this->commands); }