def nextIter(it, default=None):
    """
    Returns the next element of the iterator,
    returning the default value if it's empty,
    rather than throwing an error.
    """
    try:
        return next(iter(it))
    except StopIteration:
        return default