def _get_int_val(val, parser):
    """Get a possibly `None` single element list as an `int` by using
     the given parser on the element of the list.
     """
    if val is None:
        return 0
    return parser.parse(val[0])