From 70b53c49fd0c1808bd1c5e770b58ddc21b0edcdf Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 30 Oct 2013 13:06:15 -0700 Subject: [PATCH] Fix an issue with viewing an undiscovered commit in Diffusion Summary: If you load Diffusion between a repository being pulled and discovered, you can end up with a valid commit reference that hasn't been discovered yet. Don't fatal. Test Plan: Saw somewhat-helpful error page instead of fatal. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7448 --- src/applications/diffusion/request/DiffusionRequest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php index ae7b4b8eea..d61c5b63bf 100644 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -277,7 +277,9 @@ abstract class DiffusionRequest { 'repositoryID = %d AND commitIdentifier = %s', $repository->getID(), $this->getCommit()); - $commit->attachRepository($repository); + if ($commit) { + $commit->attachRepository($repository); + } $this->repositoryCommit = $commit; } return $this->repositoryCommit;