Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
The code was assuming that the returned value is an object. Reuse the logic from IteratorIterator.