def format_variant(variant):
    """
    Return None for null variant and strips trailing whitespaces.

    Parameters
    ----------
    variant : str, optional.
        HGVS_ formatted string.

    Returns
    -------
    str
    """
    if variant is None:
        return variant
    return variant.strip()