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:
@@ -35,6 +35,7 @@ final class PhrictionDocumentController
|
|||||||
$core_content = '';
|
$core_content = '';
|
||||||
$move_notice = '';
|
$move_notice = '';
|
||||||
$properties = null;
|
$properties = null;
|
||||||
|
$content = null;
|
||||||
|
|
||||||
if (!$document) {
|
if (!$document) {
|
||||||
|
|
||||||
@@ -194,8 +195,11 @@ final class PhrictionDocumentController
|
|||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setPolicyObject($document)
|
->setPolicyObject($document)
|
||||||
->setHeader($page_title)
|
->setHeader($page_title);
|
||||||
->setEpoch($content->getDateCreated());
|
|
||||||
|
if ($content) {
|
||||||
|
$header->setEpoch($content->getDateCreated());
|
||||||
|
}
|
||||||
|
|
||||||
$prop_list = null;
|
$prop_list = null;
|
||||||
if ($properties) {
|
if ($properties) {
|
||||||
|
|||||||
Reference in New Issue
Block a user