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:
parent
f1de90d7ef
commit
4cdfc6d1cb
1 changed files with 3 additions and 1 deletions
|
@ -57,9 +57,11 @@ class ConduitAPI_arcanist_projectinfo_Method
|
|||
|
||||
$repository_phid = null;
|
||||
$tracked = false;
|
||||
$encoding = null;
|
||||
if ($repository) {
|
||||
$repository_phid = $repository->getPHID();
|
||||
$tracked = $repository->isTracked();
|
||||
$encoding = $repository->getDetail('encoding');
|
||||
}
|
||||
|
||||
return array(
|
||||
|
@ -67,7 +69,7 @@ class ConduitAPI_arcanist_projectinfo_Method
|
|||
'phid' => $project->getPHID(),
|
||||
'repositoryPHID' => $repository_phid,
|
||||
'tracked' => $tracked,
|
||||
'encoding' => $repository->getDetail('encoding')
|
||||
'encoding' => $encoding,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue