import json


def try_parse_json(text):
    """
    Parse the given JSON and return the constructed object.

    Return the given text unmodified if parsing as JSON fails.  Return
    `None` if the given text is empty.
    """
    if not text:
        return None
    try:
        return json.loads(text)
    except json.JSONDecodeError:
        return text