Guard against nested iterator usage by throwing an exception. Issue 1361.