I am getting a NPE on a
. I have no idea why the array would be null, but heres the relevent code for it.
public void setAbility(Ability[] abilities)
{
for(Ability a : abilities)
{
sb.append(a.getName());
}
pAbility.setText(sb.toString());
}
Method called here:
Pokemon sPokemon = Pokemon.getPokemon(sender.getValue());
...
pController.setAbility(sPokemon.getAbility());
Passed getAbility():
public Ability[] getAbility()
{
return ability;
}
ability:
private Ability[] ability;
Being set through constructor here:
public Pokemon((unrelevent), Ability[] ability, (unrelevent))
{
(unrelevent)
this.ability = ability;
(unrelevent)
}
example constructor call:
pokemonList.add(bulbasaur = new Pokemon((unrelevent), new Ability[] {Ability.overgrow}, (unrelevent)));