From bc6d785b51e03afce4cd47aa4a270a8adee4e21b Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 13 May 2013 09:59:42 -0700 Subject: [PATCH] Fix exception when viewing Owners packages owned by projects you are a member of Summary: Fixes T3188. See that task for details. Test Plan: Viewed packages with and without project membership; no more exception. Reviewers: btrahan, chad Reviewed By: btrahan CC: aran Maniphest Tasks: T3188 Differential Revision: https://secure.phabricator.com/D5918 --- .../PhabricatorOwnersListController.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/applications/owners/controller/PhabricatorOwnersListController.php b/src/applications/owners/controller/PhabricatorOwnersListController.php index b77b60fcb9..4089a8983b 100644 --- a/src/applications/owners/controller/PhabricatorOwnersListController.php +++ b/src/applications/owners/controller/PhabricatorOwnersListController.php @@ -115,13 +115,17 @@ final class PhabricatorOwnersListController ->withStatus(PhabricatorProjectQuery::STATUS_ANY) ->execute(); $owner_phids = mpull($projects, 'getPHID'); - $data = queryfx_all( - $package->establishConnection('r'), - 'SELECT p.* FROM %T p JOIN %T o ON p.id = o.packageID - WHERE o.userPHID IN (%Ls) GROUP BY p.id', - $package->getTableName(), - $owner->getTableName(), - $owner_phids); + if ($owner_phids) { + $data = queryfx_all( + $package->establishConnection('r'), + 'SELECT p.* FROM %T p JOIN %T o ON p.id = o.packageID + WHERE o.userPHID IN (%Ls) GROUP BY p.id', + $package->getTableName(), + $owner->getTableName(), + $owner_phids); + } else { + $data = array(); + } $packages = $package->loadAllFromArray($data); $header = 'Owned Packages';