From 27a0265367b64cfdfc5c9790a7f14b363404f948 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 17 May 2013 03:55:45 -0700 Subject: [PATCH] Fix a small bug with empty user queries Summary: This does the wrong thing (fatals) if there are no passed PHIDs. Test Plan: No more fatal. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D5940 --- src/applications/people/storage/PhabricatorUserStatus.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/people/storage/PhabricatorUserStatus.php b/src/applications/people/storage/PhabricatorUserStatus.php index 8b771ae33d..ea1d7406a9 100644 --- a/src/applications/people/storage/PhabricatorUserStatus.php +++ b/src/applications/people/storage/PhabricatorUserStatus.php @@ -47,9 +47,14 @@ final class PhabricatorUserStatus extends PhabricatorUserDAO { } public function loadCurrentStatuses($user_phids) { + if (!$user_phids) { + return array(); + } + $statuses = $this->loadAllWhere( 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', $user_phids); + return mpull($statuses, null, 'getUserPHID'); }