Browse Source

Ensure given type exists as array key.

ADmad 8 years ago
parent
commit
1dd98ebaa2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Shell/Task/CommandTask.php

+ 4 - 0
src/Shell/Task/CommandTask.php

@@ -90,6 +90,10 @@ class CommandTask extends Shell
      */
     protected function _appendShells($type, $shells, $shellList, $skip)
     {
+        if (!isset($shellList[$type])) {
+            $shellList[$type] = [];
+        }
+
         foreach ($shells as $shell) {
             $name = Inflector::underscore(preg_replace('/(Shell|Command)$/', '', $shell));
             if (!in_array($name, $skip, true)) {