Suppress a crash when types are unknown

This commit is contained in:
Guangcong Luo
2013-05-21 17:26:45 -05:00
parent 60de68999b
commit b0e297fd7d

View File

@@ -781,9 +781,13 @@
text += '<small>(Type changed)</small><br />';
types = [pokemon.volatiles.typechange[2]];
}
text += Tools.getTypeIcon(types[0]);
if (types[1]) {
text += ' '+Tools.getTypeIcon(types[1]);
if (types) {
text += Tools.getTypeIcon(types[0]);
if (types[1]) {
text += ' '+Tools.getTypeIcon(types[1]);
}
} else {
text += 'Types unknown';
}
text += '</h2>';
var exacthp = '';