ArgumentOutOfRangeException Error in my game

I am trying to build a quiz game. I got two scripts, a Question Data and a Question Manager script. In my QuestionManager script i keep getting this error when i try to set a new question. I’ve tried to resolve it but i can’t seem to get it fixed.
Error
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[Question].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs:84)
QuestionManager.SetNewQuestion () (at Assets/QuestionManager.cs:30)
QuestionManager.Start () (at Assets/QuestionManager.cs:21)

this is my QuestionManager script

public class xxxxxxx {

	[SerializeField]
	private TextAsset questionDataXMLFile;
	public QuestionData questionData;
	private Question currentQuestion;

	[SerializeField]
	private Text factText;
	
	void Start() {
		questionData = QuestionData.LoadFromText(questionDataXMLFile.text);
		factText = GetComponent <Text>();
		SetNewQuestion ();

	}
public void SetNewQuestion() 
{
		int index = Random.Range(0, questionData.questions.Count - 1);

		Debug.Log (index);

		currentQuestion = questionData.questions[index]; 

		factText.text = currentQuestion.questionText
	}
	
	// Use this to see if user selected correct answer
	public bool CorrectAnswerSelected(int selectedAnswerID) {
		return selectedAnswerID == currentQuestion.correctAnswerID;
	}
}

You are referring to questionData.questions, when you never define questionData as containing a questions array.

Are the questions even loading? How many are being loaded? You didn’t share how QuestionData is structured, so it’s hard to say if anything is wrong there.

 Debug.Log( questionData.questions.Count );

Don’t think you should be subtracting 1 here:

int index = Random.Range(0, questionData.questions.Count - 1);

it should probably be:

 int index = Random.Range(0, questionData.questions.Count);