From 793df0cfc5c81b5966c5f22e62a92b42dcdb7c53 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 30 Mar 2011 21:38:24 -0700 Subject: [PATCH] Throw a proper 404 page when accessing a task which does not exist. --- .../controller/taskdetail/ManiphestTaskDetailController.php | 3 +++ src/applications/maniphest/controller/taskdetail/__init__.php | 1 + 2 files changed, 4 insertions(+) diff --git a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php index 144d4589f6..24c340f55a 100644 --- a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php @@ -34,6 +34,9 @@ class ManiphestTaskDetailController extends ManiphestController { $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); $task = id(new ManiphestTask())->load($this->id); + if (!$task) { + return new Aphront404Response(); + } $transactions = id(new ManiphestTransaction())->loadAllWhere( 'taskID = %d', diff --git a/src/applications/maniphest/controller/taskdetail/__init__.php b/src/applications/maniphest/controller/taskdetail/__init__.php index c711ba21b9..1f3a4ce542 100644 --- a/src/applications/maniphest/controller/taskdetail/__init__.php +++ b/src/applications/maniphest/controller/taskdetail/__init__.php @@ -6,6 +6,7 @@ +phutil_require_module('phabricator', 'aphront/response/404'); phutil_require_module('phabricator', 'applications/differential/parser/markup'); phutil_require_module('phabricator', 'applications/maniphest/constants/priority'); phutil_require_module('phabricator', 'applications/maniphest/constants/status');