Explorar o código

Ensure the bin directory exists before checking empty

Line 130 has similar logic so avoided doing the check withiin `isDirEmpty()`
Gavin Staniforth %!s(int64=9) %!d(string=hai) anos
pai
achega
c1e60a0abd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Composer/Installer/LibraryInstaller.php

+ 1 - 1
src/Composer/Installer/LibraryInstaller.php

@@ -268,7 +268,7 @@ class LibraryInstaller implements InstallerInterface
         }
 
         // attempt removing the bin dir in case it is left empty
-        if ($this->filesystem->isDirEmpty($this->binDir)) {
+        if ((is_dir($this->binDir)) && ($this->filesystem->isDirEmpty($this->binDir))) {
             @rmdir($this->binDir);
         }
     }