Browse Source

search: fixed output error when no results found.

Povilas Balzaravicius Pawka 12 years ago
parent
commit
7154ef9af7
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/Composer/Command/SearchCommand.php

+ 4 - 2
src/Composer/Command/SearchCommand.php

@@ -67,8 +67,10 @@ EOT
         $this->output = $output;
         $repos->filterPackages(array($this, 'processPackage'), 'Composer\Package\CompletePackage');
 
-        foreach ($this->lowMatches as $details) {
-            $output->writeln($details['name'] . '<comment>:</comment> '. $details['description']);
+        if (!empty($this->lowMatches)) {
+            foreach ($this->lowMatches as $details) {
+                $output->writeln($details['name'] . '<comment>:</comment> '. $details['description']);
+            }
         }
     }