def obj_version_from_env(env):
    """
    Fetch an object version from a request environment dictionary.

    This discards 'null' versions since they are not supported by the
    oio backend.
    """
    vers = env.get('oio.query', {}).get('version')
    if isinstance(vers, str) and vers.lower() == 'null':
        vers = None
    return vers