Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drupal / console-core / src / Descriptor / TextDescriptor.php
index 8018d9eff822ae3b9888bdc6fbe6bd73e3c27478..54f9808200f7a1425c4e07e5eed313e84639be88 100644 (file)
@@ -157,12 +157,14 @@ class TextDescriptor extends Descriptor
             (strpos($command->getName(), ':')?:0)
         );
         $commandData = $command->getApplication()->getData();
-        $commands = $commandData['commands'][$namespace];
         $examples = [];
-        foreach ($commands as $item) {
-            if ($item['name'] ==  $command->getName()) {
-                $examples = $item['examples'];
-                break;
+        if (array_key_exists($namespace, $commandData['commands'])) {
+            $commands = $commandData['commands'][$namespace];
+            foreach ($commands as $item) {
+                if ($item['name'] == $command->getName()) {
+                    $examples = $item['examples'];
+                    break;
+                }
             }
         }