Null Reference Exception even after check

Hey. I’ve run into a little problem today. I have a script to save and load my pokémon party to PlayerPrefs, but for some reason it isn’t working. Whenever I try to save, I get:

NullReferenceException: Object reference not set to an instance of an object
Party.savePokemon () (at Assets/Scripts/Party.cs:21)

This is my code:

public Pokemon[] party = new Pokemon[6];
public InitPokemon pokeDB = new InitPokemon();

public void savePokemon(int savenumber){
		for (int i = 0; i < party.Length; i++) {
			if (party*.ID != null) {*

_ PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.ID”, party*.ID); //LINE 21!_
_ PlayerPrefs.SetString(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Nickname”, party.nickname);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Attack”, party.Attack);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.SpAttack”, party.SpAttack);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Defense”, party.Defense);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.SpDefense”, party.SpDefense);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Speed”, party.Speed);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.HP”, party.HP);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.CurrentHP”, party.currentHP);
PlayerPrefs.SetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.CurrentEXP”, party.currentExp);
}
}
}
public void loadPokemon(int savenumber){*_

* for (int i = 0; i < party.Length; i++) {*
* if(PlayerPrefs.HasKey(“Player.”+savenumber+“.Pokemon.Party.”+i+“.ID”)){*
_ party = pokeDB.pokemonArray[PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.ID”)-1];
party*.ID = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.ID”);
party.nickname = PlayerPrefs.GetString(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Nickname”);
party.Attack = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Attack”);
party.SpAttack = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.SpAttack”);
party.Defense = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Defense”);
party.SpDefense = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.SpDefense”);
party.Speed = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.Speed”);
party.HP = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.HP”);
party.currentHP = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.CurrentHP”);
party.currentExp = PlayerPrefs.GetInt(“Player.”+savenumber+“.Pokemon.Party.”+i+“.CurrentEXP”);
}
}
}
Any idea what I have done wrong/how to fix this?_

_EDIT: The Null is probably pointing towards party.ID, because when I change it to set 1, the error start to point on line 22. However I have the party set up in the editor, + there’s the check so I don’t get why it isn’t working.*_

Um… Okay I’m just stupid. The check should have been
if(party != null)
Thanks Baste