From 061c1c1494d3ec9380f2c9ada3be7ffd91a05b8e Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 21 Aug 2014 22:53:19 -0700 Subject: [PATCH] Fix undefined $repository Auditors: btrahan --- src/applications/herald/adapter/HeraldDifferentialAdapter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/herald/adapter/HeraldDifferentialAdapter.php b/src/applications/herald/adapter/HeraldDifferentialAdapter.php index e1e7628e49..457a13313a 100644 --- a/src/applications/herald/adapter/HeraldDifferentialAdapter.php +++ b/src/applications/herald/adapter/HeraldDifferentialAdapter.php @@ -20,13 +20,17 @@ abstract class HeraldDifferentialAdapter extends HeraldAdapter { public function loadRepository() { if ($this->repository === false) { $repository_phid = $this->getObject()->getRepositoryPHID(); + if ($repository_phid) { $repository = id(new PhabricatorRepositoryQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withPHIDs(array($repository_phid)) ->needProjectPHIDs(true) ->executeOne(); + } else { + $repository = null; } + $this->repository = $repository; }