mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Fix TBA team pull for nonexistent teams.
This commit is contained in:
@@ -272,11 +272,9 @@ func getOfficialTeamInfo(teamId int) (*Team, error) {
|
||||
}
|
||||
|
||||
// Check if the result is valid. If a team is not found, just return a basic team
|
||||
if tbaTeam == nil {
|
||||
if tbaTeam.TeamNumber == 0 {
|
||||
team = Team{Id: teamId}
|
||||
return &team, nil
|
||||
}
|
||||
|
||||
} else {
|
||||
var recentAwards []TbaAward
|
||||
if eventSettings.TBAAwardsDownloadEnabled {
|
||||
recentAwards, err = getTeamAwardsFromTba(teamId)
|
||||
@@ -298,6 +296,7 @@ func getOfficialTeamInfo(teamId int) (*Team, error) {
|
||||
team = Team{Id: teamId, Name: tbaTeam.Name, Nickname: tbaTeam.Nickname,
|
||||
City: tbaTeam.Locality, StateProv: tbaTeam.Reigon,
|
||||
Country: tbaTeam.Country, RookieYear: tbaTeam.RookieYear, Accomplishments: accomplishmentsBuffer.String()}
|
||||
}
|
||||
} else {
|
||||
// If team grab is disabled, just use the team number
|
||||
team = Team{Id: teamId}
|
||||
|
||||
Reference in New Issue
Block a user