From 31abc21aaa1b0063e6fca1bd1e0729d0b757eb2d Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Tue, 28 Feb 2012 17:16:43 +0100 Subject: [PATCH] CC-3174 : showbuilder make sure the scheduled item still exists, if not throw an error. --- airtime_mvc/application/models/Scheduler.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 2c58cf2ee..3df43b5ce 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -138,6 +138,9 @@ class Application_Model_Scheduler { if ($id !== 0) { $schedItem = CcScheduleQuery::create()->findPK($id, $this->con); + if (is_null($schedItem)) { + throw new OutDatedScheduleException("The schedule you're viewing is out of date!"); + } $instance = $schedItem->getCcShowInstances($this->con); if (intval($schedule["instance"]) !== $instance->getDbId()) { throw new OutDatedScheduleException("The schedule you're viewing is out of date!"); @@ -248,7 +251,7 @@ class Application_Model_Scheduler { try { - foreach($mediaItems as $media) { + foreach ($mediaItems as $media) { Logging::log("Media Id ".$media["id"]); Logging::log("Type ".$media["type"]);