Fixed null handling in iterables

Fixes a NullPointerException in the ResultTraverser when serializing iterables that contain null values (see the added test case). This fix adds an extra null check before trying to determine the Class of an object inside the iterable.