Build::removeBuildDirectory: do not try to remove build directory of not-yet-persisted builds.

This commit is contained in:
Adirelle 2015-04-23 15:55:00 +02:00 committed by Marco Vito Moscaritolo
parent 3ca1667f12
commit 590ab5fae5

View file

@ -221,10 +221,13 @@ class Build extends BuildBase
/** /**
* Return the path to run this build into. * Return the path to run this build into.
* *
* @return string * @return string|null
*/ */
public function getBuildPath() public function getBuildPath()
{ {
if (!$this->getId()) {
return null;
}
return PHPCI_BUILD_ROOT_DIR . $this->getId(); return PHPCI_BUILD_ROOT_DIR . $this->getId();
} }
@ -235,7 +238,7 @@ class Build extends BuildBase
{ {
$buildPath = $this->getBuildPath(); $buildPath = $this->getBuildPath();
if (!is_dir($buildPath)) { if (!$buildPath || !is_dir($buildPath)) {
return; return;
} }