def nillable_string(func):
    """Decorator that retuns None if input is None."""

    def wrapper(cls, string):
        if string is None:
            return None
        else:
            return func(cls, string)
    return wrapper