1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Fix exception when encoding is not defined

Summary:
the code tries to access 'encoding' property even when the
repository is empty. The fix is to set it to null in that case.

Test Plan: run the conduit method on my sandbox and it works now.

Reviewers: grglr, epriestley, nh

Reviewed By: grglr

CC: aran, grglr

Differential Revision: 1075
This commit is contained in:
Jason Ge 2011-11-02 21:36:59 -07:00
parent f1de90d7ef
commit 4cdfc6d1cb

View file

@ -57,9 +57,11 @@ class ConduitAPI_arcanist_projectinfo_Method
$repository_phid = null; $repository_phid = null;
$tracked = false; $tracked = false;
$encoding = null;
if ($repository) { if ($repository) {
$repository_phid = $repository->getPHID(); $repository_phid = $repository->getPHID();
$tracked = $repository->isTracked(); $tracked = $repository->isTracked();
$encoding = $repository->getDetail('encoding');
} }
return array( return array(
@ -67,7 +69,7 @@ class ConduitAPI_arcanist_projectinfo_Method
'phid' => $project->getPHID(), 'phid' => $project->getPHID(),
'repositoryPHID' => $repository_phid, 'repositoryPHID' => $repository_phid,
'tracked' => $tracked, 'tracked' => $tracked,
'encoding' => $repository->getDetail('encoding') 'encoding' => $encoding,
); );
} }