1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Don't fatal on image macro list if a file has been deleted

Summary:
We added the ability to delete files a while ago, but this interface isn't happy about it.

I still render the macro so you can see/delete it, e.g.

Test Plan: Viewed a deleted macro page, got a page instead of an error. Also verified that the actual remarkup part doesn't have issues.

Reviewers: btrahan, vrana, jungejason

Reviewed By: jungejason

CC: aran

Differential Revision: https://secure.phabricator.com/D2328
This commit is contained in:
epriestley 2012-04-28 07:18:06 -07:00
parent bf505ef51c
commit 07d8503647

View file

@ -65,7 +65,8 @@ final class PhabricatorFileMacroListController
$rows = array();
foreach ($macros as $macro) {
$file_phid = $macro->getFilePHID();
$file = $files_map[$file_phid];
$file = idx($files_map, $file_phid);
$author_link = isset($author_phids[$file_phid])
? $handles[$author_phids[$file_phid]]->renderLink()
: null;
@ -82,13 +83,13 @@ final class PhabricatorFileMacroListController
phutil_render_tag(
'a',
array(
'href' => $file->getBestURI(),
'href' => $file ? $file->getBestURI() : null,
'target' => '_blank',
),
phutil_render_tag(
'img',
array(
'src' => $file->getBestURI(),
'src' => $file ? $file->getBestURI() : null,
))),
javelin_render_tag(
'a',