Skip to content

Commit

Permalink
added an additional check
Browse files Browse the repository at this point in the history
  • Loading branch information
Techno11 committed Dec 22, 2018
1 parent 581a7ef commit b388fbd
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/org/theorangealliance/datasync/tabs/TeamsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,24 @@ public void getTeamsFromFIRSTApi() {
teamsEndpoint.execute(((toaR, toaS) -> {
if (toaS) {
TeamJSON[] team = teamsEndpoint.getGson().fromJson(toaR, TeamJSON[].class);
Team eventTeam = new Team(
team[0].getTeamKey(),
1,
team[0].getTeamRegionKey(),
team[0].getTeamLeagueKey(),
team[0].getTeamNameShort(),
team[0].getTeamNameLong(),
team[0].getTeamCity() + ", " + team[0].getTeamCity() + ", " + team[0].getTeamCountry());
if(team.length == 1){
Team eventTeam = new Team(
team[0].getTeamKey(),
1,
team[0].getTeamRegionKey(),
team[0].getTeamLeagueKey(),
team[0].getTeamNameShort(),
team[0].getTeamNameLong(),
team[0].getTeamCity() + ", " + team[0].getTeamCity() + ", " + team[0].getTeamCountry());
teamsList.add(eventTeam);
} else {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("Non-Existant Team");
alert.setContentText("This team is not on TOA, and therefore, must not have been registered in TIMS. Please contact [email protected] soon so we can manually add the team.");

alert.showAndWait();
}
} else {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
Expand Down

0 comments on commit b388fbd

Please sign in to comment.