import json


def convert_json(data):
    """Convert string to JSON if possible or return None otherwise.

    Args:
        data (str): Data.

    Returns:
        dict: Loaded dict.
    """
    try:
        return json.loads(data)
    except ValueError:
        return None