Skip to content

Commit

Permalink
Fix notice error when there are no requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 5, 2012
1 parent 1cc5206 commit 8497677
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Cake/Routing/Router.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ public static function popRequest() {
*/ */
public static function getRequest($current = false) { public static function getRequest($current = false) {
if ($current) { if ($current) {
return self::$_requests[count(self::$_requests) - 1]; $i = count(self::$_requests) - 1;
return isset(self::$_requests[$i]) ? self::$_requests[$i] : null;
} }
return isset(self::$_requests[0]) ? self::$_requests[0] : null; return isset(self::$_requests[0]) ? self::$_requests[0] : null;
} }
Expand Down

0 comments on commit 8497677

Please sign in to comment.