Fixed exception on empty Build::create_date. Issue #162.

This commit is contained in:
Dmitry Khomutov 2018-03-08 23:32:43 +07:00
parent 2bbdd8c393
commit 7bbd2e54db
No known key found for this signature in database
GPG key ID: EC19426474B37AAC

View file

@ -902,9 +902,10 @@ class Build extends Model
return null;
}
$createDate = $this->getCreateDate();
if (empty($this->buildDirectory)) {
$this->buildDirectory = $this->getProjectId() . '/' . $this->getId() . '_' . substr(
md5(($this->getId() . '_' . $this->getCreateDate()->format('Y-m-d H:i:s'))
md5(($this->getId() . '_' . ($createDate ? $createDate->format('Y-m-d H:i:s') : null))
), 0, 8);
}
@ -920,9 +921,10 @@ class Build extends Model
return null;
}
$createDate = $this->getCreateDate();
if (empty($this->buildBranchDirectory)) {
$this->buildBranchDirectory = $this->getProjectId() . '/' . $this->getBranch() . '_' . substr(
md5(($this->getBranch() . '_' . $this->getProject()->getCreateDate()->format('Y-m-d H:i:s'))
md5(($this->getBranch() . '_' . ($createDate ? $createDate->format('Y-m-d H:i:s') : null))
), 0, 8);
}