From 281bdf87cf6354ee04e3a2a33f0c110df6d70f9c Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 13 Apr 2015 14:44:26 -0700 Subject: [PATCH] Fix a fatal for 404s in Phriction Summary: Fixes T7817. Not all documents have `$content`, so don't try to set a timestamp if there's no content. An example is `/w/asdlkfnalskdnfaslk/`, i.e. the 404 document. Test Plan: Hit `/w/junk/` and got a nice 404 instead of a fatal. Reviewers: chad, btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7817 Differential Revision: https://secure.phabricator.com/D12401 --- .../phriction/controller/PhrictionDocumentController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index 6883858ad5..95666874ef 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -35,6 +35,7 @@ final class PhrictionDocumentController $core_content = ''; $move_notice = ''; $properties = null; + $content = null; if (!$document) { @@ -194,8 +195,11 @@ final class PhrictionDocumentController $header = id(new PHUIHeaderView()) ->setUser($user) ->setPolicyObject($document) - ->setHeader($page_title) - ->setEpoch($content->getDateCreated()); + ->setHeader($page_title); + + if ($content) { + $header->setEpoch($content->getDateCreated()); + } $prop_list = null; if ($properties) {