From e411d75964e51686ce95d9a9cc245193160f9f70 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 18 Dec 2017 06:26:38 -0800 Subject: [PATCH] Fix an issue where blame could fatal for unrecognized authors Summary: See PHI255. See . 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 --- .../controller/DiffusionBrowseController.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php index 77ec8e46ca..92181ff551 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseController.php @@ -1804,10 +1804,17 @@ final class DiffusionBrowseController extends DiffusionController { // revision. We just render a blank for alignment. $style = null; $href = null; + $sigil = null; + $meta = null; } else { $src = $handles[$phid]->getImageURI(); $style = 'background-image: url('.$src.');'; $href = $handles[$phid]->getURI(); + $sigil = 'has-tooltip'; + $meta = array( + 'tip' => $handles[$phid]->getName(), + 'align' => 'E', + ); } $links[$phid] = javelin_tag( @@ -1816,11 +1823,8 @@ final class DiffusionBrowseController extends DiffusionController { 'class' => 'diffusion-author-link', 'style' => $style, 'href' => $href, - 'sigil' => 'has-tooltip', - 'meta' => array( - 'tip' => $handles[$phid]->getName(), - 'align' => 'E', - ), + 'sigil' => $sigil, + 'meta' => $meta, )); }