def getSafe(dict,key):
    """
    Tests if the dictionary has the given key. If so, it retrieves the value and returns it. If not, returns None.
    :param dict:
    :param key:
    :return:
    """
    if key in dict and dict[key]:
        return dict[key]
    else:
        return None