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

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
This commit is contained in:
epriestley 2015-04-13 14:44:26 -07:00
parent dd22db18ff
commit 281bdf87cf

View file

@ -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) {