From 02e1dc7443df6d49e26084679e922a67ad90ddb7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 18 Jul 2013 20:47:29 -0700 Subject: [PATCH] Fix a fatal in the feed handler, grotesquely Summary: The feed handler in the IRC bot calls Conduit to render feed stories, which sometimes end up here with no user. "Fix" it. This patch is really bad but the underlying code is a mess too. Fixing this is properly is blocked on T2222/T2217. Until those land, stop fataling at least. Test Plan: @dctrwatson confirmed this fixed things. Reviewers: dctrwatson, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6497 --- src/view/phui/PHUIFeedStoryView.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/view/phui/PHUIFeedStoryView.php b/src/view/phui/PHUIFeedStoryView.php index 35c782ee72..0c455ad9e8 100644 --- a/src/view/phui/PHUIFeedStoryView.php +++ b/src/view/phui/PHUIFeedStoryView.php @@ -189,7 +189,13 @@ final class PHUIFeedStoryView extends AphrontView { } if ($this->epoch) { - $foot = phabricator_datetime($this->epoch, $this->user); + // TODO: This is really bad; when rendering through Conduit and via + // renderText() we don't have a user. + if ($this->user) { + $foot = phabricator_datetime($this->epoch, $this->user); + } else { + $foot = null; + } } else { $foot = pht('No time specified.'); }