mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +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;
|
$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,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue