From 7463f9b3a9dbd76501e6bd1abfb6ef0d3b182f4c Mon Sep 17 00:00:00 2001 From: Svemir Brkic Date: Thu, 14 Jun 2012 10:42:37 -0700 Subject: [PATCH] Only get phid if project exists Summary: If a project phriction page already exists, but object does not, avoid a fatal error. Test Plan: See https://github.com/facebook/phabricator/issues/123 Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2749 --- .../phriction/controller/PhrictionDocumentController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index 1a99de9cb2..f18a9f7bc2 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -115,7 +115,9 @@ final class PhrictionDocumentController $project = id(new PhabricatorProject())->loadOneWhere( 'phrictionSlug = %s', PhrictionDocument::getProjectSlugIdentifier($slug)); - $project_phid = $project->getPHID(); + if ($project) { + $project_phid = $project->getPHID(); + } } $phids = array_filter(