From 79e8a637c2ef12dabdfd54479ff30cb28058b817 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 24 May 2012 15:17:42 -0700 Subject: [PATCH] Minor, fail gracefully if there are data integrity problems until I can fix oauth transactions. --- src/applications/people/query/PhabricatorPeopleQuery.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/people/query/PhabricatorPeopleQuery.php b/src/applications/people/query/PhabricatorPeopleQuery.php index 1cd5957f65..ef53341622 100644 --- a/src/applications/people/query/PhabricatorPeopleQuery.php +++ b/src/applications/people/query/PhabricatorPeopleQuery.php @@ -75,7 +75,12 @@ final class PhabricatorPeopleQuery extends PhabricatorOffsetPagedQuery { mpull($users, 'getPHID')); $emails = mpull($emails, null, 'getUserPHID'); foreach ($users as $user) { - $user->attachPrimaryEmail($emails[$user->getPHID()]); + // Fail gracefully if we have data integrity problems. + if (empty($emails[$user->getPHID()])) { + $user->attachPrimaryEmail(new PhabricatorUserEmail()); + } else { + $user->attachPrimaryEmail($emails[$user->getPHID()]); + } } }