1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00

Fix undefined $repository

Auditors: btrahan
This commit is contained in:
epriestley 2014-08-21 22:53:19 -07:00
parent c1e8d97069
commit 061c1c1494

View file

@ -20,13 +20,17 @@ abstract class HeraldDifferentialAdapter extends HeraldAdapter {
public function loadRepository() { public function loadRepository() {
if ($this->repository === false) { if ($this->repository === false) {
$repository_phid = $this->getObject()->getRepositoryPHID(); $repository_phid = $this->getObject()->getRepositoryPHID();
if ($repository_phid) { if ($repository_phid) {
$repository = id(new PhabricatorRepositoryQuery()) $repository = id(new PhabricatorRepositoryQuery())
->setViewer(PhabricatorUser::getOmnipotentUser()) ->setViewer(PhabricatorUser::getOmnipotentUser())
->withPHIDs(array($repository_phid)) ->withPHIDs(array($repository_phid))
->needProjectPHIDs(true) ->needProjectPHIDs(true)
->executeOne(); ->executeOne();
} else {
$repository = null;
} }
$this->repository = $repository; $this->repository = $repository;
} }