From 590ab5fae580a59afc54d4fc1e8cd9cf9226e9f0 Mon Sep 17 00:00:00 2001 From: Adirelle Date: Thu, 23 Apr 2015 15:55:00 +0200 Subject: [PATCH] Build::removeBuildDirectory: do not try to remove build directory of not-yet-persisted builds. --- PHPCI/Model/Build.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php index 2681498f..a0019438 100644 --- a/PHPCI/Model/Build.php +++ b/PHPCI/Model/Build.php @@ -221,10 +221,13 @@ class Build extends BuildBase /** * Return the path to run this build into. * - * @return string + * @return string|null */ public function getBuildPath() { + if (!$this->getId()) { + return null; + } return PHPCI_BUILD_ROOT_DIR . $this->getId(); } @@ -235,7 +238,7 @@ class Build extends BuildBase { $buildPath = $this->getBuildPath(); - if (!is_dir($buildPath)) { + if (!$buildPath || !is_dir($buildPath)) { return; }