def call_if_attribute(obj, attr, *args, **kwargs):
    """
    Call object method, if it exists.

    Arguments:
        obj (object): The object.
        attr (str): The name of the object method.
        *args (optional): Arguments for method.
        **kwargs (optional): Keyword arguments for method.

    Returns:
        Return value of calling method, or None if object does not have method.
    """
    op = getattr(obj, attr, None)
    if callable(op):
        return op(*args, **kwargs)
