from pathlib import Path


def check_if_file_exists(file, dir):
    """Checks if a file exists in a directory and returns its full path if it does exist.

    Args:
        file (str): Full path of the file to check.
        dir (str): Directory to check for the existence of the file.

    Returns:
        str: Full path of the file if it exists. It returns None, if the file doesn't exist.

    """
    my_file = dir / Path(file)
    if my_file.is_file():
        return my_file.absolute()

    # Check windows case with .exe extension
    my_file = my_file.with_suffix(".exe")
    if my_file.is_file():
        return my_file.absolute()