Fix parseDetails erroring when passed nil details

This commit is contained in:
Bill Meltsner 2013-10-29 02:09:35 -07:00
parent eada1ce8c0
commit 5f01c13533

View File

@ -4401,6 +4401,7 @@ function Battle(frame, logFrame, noPreload) {
} */
this.parseDetails = function (name, pokemonid, details, output) {
if (!output) output = {};
if (!details) details = "";
output.details = details;
output.name = name;
output.species = name;
@ -4518,7 +4519,7 @@ function Battle(frame, logFrame, noPreload) {
pokemon.searchid = searchid;
pokemon.ident = pokemonid;
if (pokemon.needsReplace) {
pokemon = self.p1.newPokemon(self.parseDetails(name, pokemonid, details || ""), i);
pokemon = self.p1.newPokemon(self.parseDetails(name, pokemonid, details), i);
}
}
pokemon.slot = slot;