1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

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
This commit is contained in:
epriestley 2012-01-11 15:53:03 -08:00
parent 49cf1ca10c
commit 8b3ab97d64

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -105,7 +105,7 @@ class PhabricatorProjectListController
foreach ($projects as $project) {
$phid = $project->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(