Fix NPE caused by a null team.