IndexOutOfRangeException: Array HELP

for the life of me i cannot find out what the problem is with my array, please help me :open_mouth:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class Exercise : MonoBehaviour {

public string[] Exercises;
public Text exerciseText;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

public void ExerciseButtonPressed() {

	exerciseText.text = Exercises[Random.Range(0,9)];

}

}

First you need check if Exercises is null and check if is greather than zero.

After this you need use the Length of array for the max value of random function.

 `
    public void ExerciseButtonPressed()
    {
        if (null != Exercises&& Exercises.Length > 0)
        {
            exerciseText.text = Exercises[Random.Range(0, Exercises.Length)];
        }
    }
    `