NullReferenceException: Help

i am trying to create a function that shuffles a list filled with objects that contain a set of vars. here is my code, the errors say line 5

`function Shuffle (list : List.)
{
var r : int;
var finished : boolean = false;
var temp : List.;

while (finished)
{
	r = Random.Range(0, deckLength);
	while (temp.Contains(list[r]))
	{
	r = Random.Range(0, deckLength);
	}
	temp.Add(list[r]);
	deckLength = list.Count;
	
	if (list == null)
	{
		list = temp;	
		finished = true;
	}
}	

}`

Thank you for your help :smiley:

Your formatting for your code block is a little wanky, but I think you need to call the constructor on temp to create a new object before you start working with it. In other words, calling temp = new List.. Your chevrons (arrows) are being formatted out of your code, so not sure what type those lists are.