team_name will never be null. You should check either the length or compare it with empty string

$team_name !== ""