def lookup_field(line, column):
    """
    Lookup the value of a given (numbered) column in a given Line

    Returns None if either the column or the line is None
    """

    # During merge, it is not guaranteed that each input file to the
    # merge has a matching line...

    if not line:
        return None

    # ...or that the input line has a column of the given name...

    if column == None:
        return None

    # ...or that the line in question bothers to supply every required
    # column

    try:
        return line.row[column]
    except IndexError:
        return None