def null_distance_results(string1, string2, max_distance):
    """Determines the proper return value of an edit distance function
    when one or both strings are null.

    Parameters
    ----------
    string_1 : str
        Base string.
    string_2 : str
        The string to compare.
    max_distance : int
        The maximum distance allowed.

    Returns
    -------
    int
        -1 if the distance is greater than the max_distance, 0 if the
        strings are equivalent (both are None), otherwise a positive
        number whose magnitude is the length of the string which is not
        None.
    """
    if string1 is None:
        if string2 is None:
            return 0
        else:
            return len(string2) if len(string2) <= max_distance else -1
    return len(string1) if len(string1) <= max_distance else -1
