From 4cdfc6d1cbb5c4fc33acf748a23f08534678a4fe Mon Sep 17 00:00:00 2001 From: Jason Ge Date: Wed, 2 Nov 2011 21:36:59 -0700 Subject: [PATCH] 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 --- .../projectinfo/ConduitAPI_arcanist_projectinfo_Method.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/conduit/method/arcanist/projectinfo/ConduitAPI_arcanist_projectinfo_Method.php b/src/applications/conduit/method/arcanist/projectinfo/ConduitAPI_arcanist_projectinfo_Method.php index 2673aefef0..313e8abe09 100644 --- a/src/applications/conduit/method/arcanist/projectinfo/ConduitAPI_arcanist_projectinfo_Method.php +++ b/src/applications/conduit/method/arcanist/projectinfo/ConduitAPI_arcanist_projectinfo_Method.php @@ -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, ); }