From 8b3ab97d64dac931a3644d3168ace8b5c9cae527 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 11 Jan 2012 15:53:03 -0800 Subject: [PATCH] Fix fatal on project list Summary: Until T605 gets fixed, you might end up with a Project without a Profile if the Profile insert failed. This fatals the list view; instead, don't fatal if a profile is missing. (At some point we should probably just merge this field into the Project object, I was just mimicking the user/profile separation but we have partial-field object support now and Projects aren't super heavily used or very big.) Test Plan: - Viewed list view including a project with a missing profile. - Edited the project, creating its profile. Reviewers: btrahan, jungejason Reviewed By: btrahan CC: arice, aran, btrahan Differential Revision: https://secure.phabricator.com/D1368 --- .../list/PhabricatorProjectListController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/applications/project/controller/list/PhabricatorProjectListController.php b/src/applications/project/controller/list/PhabricatorProjectListController.php index d8ac9ed702..b341fddad1 100644 --- a/src/applications/project/controller/list/PhabricatorProjectListController.php +++ b/src/applications/project/controller/list/PhabricatorProjectListController.php @@ -1,7 +1,7 @@ getPHID(); - $profile = $profiles[$phid]; + $profile = idx($profiles, $phid); $affiliations = $affil_groups[$phid]; $group = idx($groups, $phid, array()); @@ -113,8 +113,12 @@ class PhabricatorProjectListController $population = count($affiliations); - $blurb = $profile->getBlurb(); - $blurb = phutil_utf8_shorten($blurb, 64); + if ($profile) { + $blurb = $profile->getBlurb(); + $blurb = phutil_utf8_shorten($blurb, 64); + } else { + $blurb = null; + } $rows[] = array(