Make sure the result exists before checking for an empty string.