mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-26 04:07:56 -05:00
Fix crash on certain kinds of corrupted teams
This commit is contained in:
@@ -147,6 +147,17 @@
|
||||
|
||||
var team = teams[i];
|
||||
|
||||
if (team && !team.team) {
|
||||
team = null;
|
||||
}
|
||||
if (team) {
|
||||
for (var j=0; j<team.team.length; j++) {
|
||||
if (!team.team[j]) {
|
||||
team = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!team) {
|
||||
buf += '<li>Error: A corrupted team was dropped</li>';
|
||||
teams.splice(i,1);
|
||||
|
||||
Reference in New Issue
Block a user