From 83a5f1479d2fa8282a43a93e2e8ea4c54fbc5505 Mon Sep 17 00:00:00 2001 From: Edward Speyer Date: Mon, 18 Jun 2012 21:07:12 -0700 Subject: [PATCH] Arrayish fields should always return arrays Summary: Array-like fields in HerladCommitAdapter should always return things of type array. If they return array(...) or null, then array_*() functions sporadically break. Test Plan: Ran a PhabricatorRepositoryCommitHeraldWorker for a troublesome commit. Failed before; fails no more. Reviewers: epriestley, jungejason Reviewed By: epriestley CC: aran, Korvin, vdt Maniphest Tasks: T1385 Differential Revision: https://secure.phabricator.com/D2793 --- src/applications/herald/adapter/HeraldCommitAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php index e872bbb725..85dfcb30fc 100644 --- a/src/applications/herald/adapter/HeraldCommitAdapter.php +++ b/src/applications/herald/adapter/HeraldCommitAdapter.php @@ -175,13 +175,13 @@ final class HeraldCommitAdapter extends HeraldObjectAdapter { case HeraldFieldConfig::FIELD_DIFFERENTIAL_REVIEWERS: $revision = $this->loadDifferentialRevision(); if (!$revision) { - return null; + return array(); } return $revision->getReviewers(); case HeraldFieldConfig::FIELD_DIFFERENTIAL_CCS: $revision = $this->loadDifferentialRevision(); if (!$revision) { - return null; + return array(); } return $revision->getCCPHIDs(); default: