Check if the key exists before trying to test it