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

Fix an issue where blame could fatal for unrecognized authors

Summary: See PHI255. See <https://discourse.phabricator-community.org/t/error-generating-blame-data/766>.

Test Plan:
  - Viewed a file contributed to by users with no Phabricator user accounts, in Diffusion.
  - Enabled blame.
  - Before patch: blame failed, fatal in logs.
  - After patch: blame worked.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18833
This commit is contained in:
epriestley 2017-12-18 06:26:38 -08:00
parent 8dccf05c4c
commit e411d75964

View file

@ -1804,10 +1804,17 @@ final class DiffusionBrowseController extends DiffusionController {
// revision. We just render a blank for alignment. // revision. We just render a blank for alignment.
$style = null; $style = null;
$href = null; $href = null;
$sigil = null;
$meta = null;
} else { } else {
$src = $handles[$phid]->getImageURI(); $src = $handles[$phid]->getImageURI();
$style = 'background-image: url('.$src.');'; $style = 'background-image: url('.$src.');';
$href = $handles[$phid]->getURI(); $href = $handles[$phid]->getURI();
$sigil = 'has-tooltip';
$meta = array(
'tip' => $handles[$phid]->getName(),
'align' => 'E',
);
} }
$links[$phid] = javelin_tag( $links[$phid] = javelin_tag(
@ -1816,11 +1823,8 @@ final class DiffusionBrowseController extends DiffusionController {
'class' => 'diffusion-author-link', 'class' => 'diffusion-author-link',
'style' => $style, 'style' => $style,
'href' => $href, 'href' => $href,
'sigil' => 'has-tooltip', 'sigil' => $sigil,
'meta' => array( 'meta' => $meta,
'tip' => $handles[$phid]->getName(),
'align' => 'E',
),
)); ));
} }