fix KeyError if there is no ipv4/ipv6 key in the session