// Fix default value of iterator in collections
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11407 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -65,7 +65,7 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
|
||||
/**
|
||||
* @var int Collection iterator
|
||||
*/
|
||||
protected $iterator;
|
||||
protected $iterator = 0;
|
||||
|
||||
/**
|
||||
* @var int Total of elements for iteration
|
||||
@@ -252,7 +252,7 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return $this->results[$this->iterator];
|
||||
return isset($this->results[$this->iterator]) ? $this->results[$this->iterator] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user