From ae03cb7fff6995316cb9cfe6a9228f41cf702668 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 21 Mar 2014 19:11:48 -0700 Subject: [PATCH] Issue a proper 404 when trying to edit nonexistent events Summary: We'll fatal a little later here when trying to call methods. 404 instead. Test Plan: Visited `/calendar/event/edit/9999999/` or similar. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8591 --- .../controller/PhabricatorCalendarEventEditController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php index 8209756a32..e6bcaf0ec2 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php @@ -47,6 +47,9 @@ final class PhabricatorCalendarEventEditController PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); + if (!$status) { + return new Aphront404Response(); + } $end_time->setValue($status->getDateTo()); $start_time->setValue($status->getDateFrom());