When manipulating returned data to, for example, unset some of the entities (due to Search API returning duplicates, for example), the EntityIterator uses next() to advance the cursor by one, but that cursor may not exist due to prior manipulation of the EntityIterator's data. So iterating directly on this changed EI will cause problems.
When manipulating returned data to, for example, unset some of the entities (due to Search API returning duplicates, for example), the EntityIterator uses
next()
to advance the cursor by one, but that cursor may not exist due to prior manipulation of the EntityIterator's data. So iterating directly on this changed EI will cause problems.Solutions:
getData
and iterate over that