Browse Source

Prevent exception when glob fails to return an array, fixes #1357

Jordi Boggiano 12 years ago
parent
commit
488624675c
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/Composer/Factory.php

+ 4 - 2
src/Composer/Factory.php

@@ -100,8 +100,10 @@ class Factory
                             continue;
                         }
                     }
-                    foreach (glob($oldPathMatch) as $child) {
-                        @rename($child, $dir.'/'.basename($child));
+                    if (is_array($children = glob($oldPathMatch))) {
+                        foreach ($children as $child) {
+                            @rename($child, $dir.'/'.basename($child));
+                        }
                     }
                     @unlink($oldPath);
                 }