Few lines above, we already test for relay_agent_ip_to_vlan_id, if the controller doesn't program it yet, relay_agent_ip_to_vlan_id is INVALID_VLAN and we log and return.
At line 350, we are sure that vlan_id = relay_agent_ip_to_vlan_id and valid.