From 0011068d7a69e1d494220c938ffcbe1c18c88e8a Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 13 Dec 2013 18:20:42 -0800 Subject: [PATCH] Fix an issue in Harbormaster when a buildable has no repository Summary: Not every revision belongs to a repository, so we might end up here with `$repo` still equal to `null`. Don't fatal if we do. Test Plan: iiam Reviewers: btrahan, hach-que, zeeg Reviewed By: hach-que CC: aran Maniphest Tasks: T1049 Differential Revision: https://secure.phabricator.com/D7771 --- .../harbormaster/storage/build/HarbormasterBuild.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php index 96e25ab239..c569d3cf1b 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php @@ -183,9 +183,12 @@ final class HarbormasterBuild extends HarbormasterDAO $repo = $object->getRepository(); } - $results['repository.callsign'] = $repo->getCallsign(); - $results['repository.vcs'] = $repo->getVersionControlSystem(); - $results['repository.uri'] = $repo->getPublicRemoteURI(); + if ($repo) { + $results['repository.callsign'] = $repo->getCallsign(); + $results['repository.vcs'] = $repo->getVersionControlSystem(); + $results['repository.uri'] = $repo->getPublicRemoteURI(); + } + $results['step.timestamp'] = time(); $results['build.id'] = $this->getID();