Problem with random music script

Hi, I have a problem with my music manager script,
I want to play random songs that are in a list but to avoid to play them twice in a row, I add them to another list and remove them from the first one, until that one is empty,

I have an error with the line 71 NullReferenceException: Object reference not set to an instance of an object when I start the game.

Now, that list is effectively empty if the if statement is not taken into account, but the if statement should be taken into account and the list should be filled with the songs added every time a new one is played, so I don’t really understand my mistake here, nor how to fix it…

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MusicManager : MonoBehaviour
{
    private AudioSource audioSource;
    
    //The public list containing all the songs to be played
    public List<AudioClip> musicTracksList;
    //The private, empty list that will contain the songs that have been played
    List<AudioClip> musicTracksPlayed;

    private void Start()
    {
        audioSource = GetComponent<AudioSource>();
        
        
    }
    
    //For the main menu, play the first track in the list / That works fine
    public void PlayMusicMainMenu()
    {
        audioSource.loop = true;
        audioSource.clip = musicTracksList[0];
        audioSource.Play();
    }

    //Function engaged by the Game Manager when the game starts / The RandomTrack doesn't work
    public void PlayGameMusic()
    {

        audioSource.clip = RandomTrack();
        audioSource.Play();
        float trackLength = audioSource.clip.length;
        StartCoroutine(NextSong(trackLength));
        


    }





    /*Find a random track to be played for the PlayGameMusic
     * If there are tracks in the music tracks list, pick a random one, return it as the audio clip to be played,
     * remove it from the music tracks list and add it to the played tracks list.
     * When there are no more tracks in the music track list, put all the tracks from the played tracks list in
     * the music track list and re-do the random picking with the previous steps.
     * Also, clear the played track list so it's empty again.
     * 
     * Unity says there is an error with the line 71 NullReferenceException: Object reference not set to an instance of an object */

    AudioClip RandomTrack()
    {
        Debug.Log("La liste principale est elle vide ? " + musicTracksList==null);

        if (musicTracksList.Count > 0)
        {
            int RandomTrackID = Random.Range(0, musicTracksList.Count);
            AudioClip TrackToPlay = musicTracksList[RandomTrackID];
            musicTracksList.Remove(TrackToPlay);
            musicTracksPlayed.Add(TrackToPlay);
           
            return TrackToPlay;
        }
        else
        {
            musicTracksList = musicTracksPlayed;
            musicTracksPlayed.Clear();
            int RandomTrackID = Random.Range(0, musicTracksList.Count);
            AudioClip TrackToPlay = musicTracksList[RandomTrackID];
            musicTracksList.Remove(TrackToPlay);
            musicTracksPlayed.Add(TrackToPlay);
            
            return TrackToPlay;

        }


    }

    //Coroutine to play the next track when the one playing is over.

    IEnumerator NextSong(float trackDuration)
    {
        yield return new WaitForSeconds(trackDuration);
        PlayGameMusic();
    }

    
    
}

Thank you for your inputs.

Found a solution to this issue.
The first mistake was that the lists were not initialized, thanks @SpaceManDan
Then, it would throw an out of range issue.
That was due to not adding tracks from musicTracksPlayed to musicTrackList with a foreach loop.

It works fine now.

Here is the final script :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MusicManager : MonoBehaviour
{
    private AudioSource audioSource;
    public List<AudioClip> musicTracksList = new List<AudioClip>();
    List<AudioClip> musicTracksPlayed = new List<AudioClip>();


    private void Start()
    {
        audioSource = GetComponent<AudioSource>();
    }
    public void PlayMusicMainMenu()
    {
        audioSource.loop = true;
        audioSource.clip = musicTracksList[0];
        audioSource.Play();
    }

    public void PlayGameMusic()
    {

        audioSource.clip = SetMusicToPlay();
        audioSource.Play();
        Debug.Log(audioSource.clip);
        float trackLength = audioSource.clip.length;
        StartCoroutine(NextSong(trackLength));



    }

    AudioClip SetMusicToPlay()
    {
        if (musicTracksList.Count > 0)
        {
            int trackID = Random.Range(0, musicTracksList.Count);
            AudioClip trackToPlay = musicTracksList[trackID];
            musicTracksPlayed.Add(trackToPlay);
            musicTracksList.Remove(trackToPlay);
            Debug.Log("Music Tracks Played has " + musicTracksPlayed.Count + " elements");
            Debug.Log("Music Tracks List has " + musicTracksList.Count + " elements");
            return trackToPlay;
        }
        else
        {
            Debug.Log("Engage the copy from the played track list to the track list");
            CopyToTracksList();

            int trackID = Random.Range(0, musicTracksList.Count);
            AudioClip trackToPlay = musicTracksList[trackID];
            musicTracksPlayed.Clear();
            musicTracksPlayed.Add(trackToPlay);
            musicTracksList.Remove(trackToPlay);

            Debug.Log("Music Tracks List has " + musicTracksList.Count + " elements");

            Debug.Log("Music Tracks Played has " + musicTracksPlayed.Count + " elements");
            return trackToPlay;

        }


    }


    private void CopyToTracksList()
    {
        foreach(AudioClip trackToAdd in musicTracksPlayed)
        {
            musicTracksList.Add(trackToAdd);
            
        }
    }












    IEnumerator NextSong(float trackDuration)
    {
        yield return new WaitForSeconds(trackDuration);
        PlayGameMusic();
    }


}