diff --git a/src/PHPCensor/Command/ScheduleBuildCommand.php b/src/PHPCensor/Command/ScheduleBuildCommand.php index 5deaa04b..82090ed2 100644 --- a/src/PHPCensor/Command/ScheduleBuildCommand.php +++ b/src/PHPCensor/Command/ScheduleBuildCommand.php @@ -73,7 +73,8 @@ class ScheduleBuildCommand extends Command /** @var Project $project */ foreach ($projects as $project) { - $latestBuild = $this->buildStore->getByProjectId($project->getId(), 1); + $latestBuild = $this->buildStore->getLatestBuilds($project->getId(), 1); + if ($latestBuild['count'] > 0) { /** @var Build $build */ $build = $latestBuild['items'][0];