From 1deee3cb659174875553ff813f961d21e2cc10cd Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 29 Feb 2012 14:54:54 -0500 Subject: [PATCH] CC-3365: Airtime API returns a non-null value for next item when there is no next item. - Improved check for determining if there is another element in the result set which is used to compute the next value. --- airtime_mvc/application/models/Schedule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 29fb8654d..8321627a6 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -197,7 +197,7 @@ class Application_Model_Schedule { "ends"=>$row[$i]["ends"], "media_item_played"=>$row[0]["media_item_played"], "record"=>0); - if ( $i +1 <= $numberOfRows){ + if ( isset($row[$i+1])){ $results['next'] = array("name"=>$row[$i+1]["artist_name"]." - ".$row[$i+1]["track_title"], "starts"=>$row[$i+1]["starts"], "ends"=>$row[$i+1]["ends"]);