From 8d23f4d5c5cc613666db2e9c331a023ab44f3de0 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Tue, 21 May 2013 16:39:46 -0500 Subject: [PATCH] Don't crash teambuilder on corrupted team --- js/client-teambuilder.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/client-teambuilder.js b/js/client-teambuilder.js index 5a84ae499..a26f05dcc 100644 --- a/js/client-teambuilder.js +++ b/js/client-teambuilder.js @@ -136,6 +136,14 @@ var team = teams[i]; + if (!team) { + buf += '
  • Error: corrupted team
  • '; + teams.splice(i,1); + i--; + if (this.deletedTeamLoc && this.deletedTeamLoc > i) this.deletedTeamLoc--; + continue; + } + var formatText = ''; if (team.format) { formatText = '['+team.format+'] ';