Permalink
Browse files

Fix notice error when there are no requests.

  • Loading branch information...
1 parent 1cc5206 commit 8497677e97b68cdac1f00ed7a8196155c6779bfa @markstory markstory committed Apr 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Cake/Routing/Router.php
@@ -617,7 +617,8 @@ public static function popRequest() {
*/
public static function getRequest($current = false) {
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;
}

0 comments on commit 8497677

Please sign in to comment.