State Machine help, I am getting a NullReferanceException: Object reference not set to an instance of an object when trying to test the project.

For this project, I am building a traffic light that uses a data model and a state machine. The following code is in my data model:

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

public class TrafficLight : MonoBehaviour
{
    //Green light timer
    [SerializeField]
    private float greenLight = 5.0f;

    //Yellow light timer
    [SerializeField]
    private float yellowLight = 5.0f;

    //Red light timer
    [SerializeField]
    private float redLight = 5.0f;

    private float timePassed;

    void Start()
    {
        ResetTimeSinceLastTransition();
        GetComponent<Renderer>().material.color = Color.grey;
    }

    void Update()
    {
        timePassed += Time.deltaTime;
    }

    void ResetTimeSinceLastTransition()
    {
        timePassed = 0.0f;
    }

    public float GetTime()
    {
        return timePassed;
    }

    public float GetGreenTime()
    {
        return greenLight;
    }

    public float GetYellowTime()
    {
        return yellowLight;
    }

    public float GetRedTime()
    {
        return redLight;
    }

}//Data Model

Here is my state machine script:

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

public class TrafficLightStateMachine : MonoBehaviour
{

    private TrafficLight target;
    private TrafficStates curState = TrafficStates.greenLight;
    private Dictionary<TrafficStates, Action> fsm = new Dictionary<TrafficStates, Action>();

    enum TrafficStates
    {
        greenLight,
        yellowLight,
        redLight
        
    }

    void Start()
    {
        //access to the Data Model
        GetComponent<TrafficLight>();
        //dictionary
        fsm.Add(TrafficStates.redLight, new Action(StateRed));
        fsm.Add(TrafficStates.yellowLight, new Action(StateYellow));
        fsm.Add(TrafficStates.greenLight, new Action(StateGreen));
        //default state
        SetState(TrafficStates.greenLight);
    }
    
    void Update()
    {
        fsm[curState].Invoke();
    }

    void StateGreen()
    {
        if (target.GetGreenTime() > target.GetTime())
        {
            GameObject yellowObj = GameObject.Find("YellowLight");
            yellowObj.GetComponent<Renderer>().material.color = Color.yellow;
            SetState(TrafficStates.yellowLight);
        }
    }

    void StateYellow()
    {
        if (target.GetYellowTime() > target.GetTime())
        {
            GameObject redObj = GameObject.Find("RedLight");
            redObj.GetComponent<Renderer>().material.color = Color.red;
            SetState(TrafficStates.redLight);
        }
    }

    void StateRed()
    {
        if (target.GetRedTime() > target.GetTime())
        {
            GameObject greenObj = GameObject.Find("GreenLight");
            greenObj.GetComponent<Renderer>().material.color = Color.green;
            SetState(TrafficStates.greenLight);
        }
    }

    void SetState(TrafficStates newState)
    {
        curState = newState;
    }

}//State Machine

When I run the project in Unity, I am getting the following error:
NullReferenceException: Object reference not set to an instance of an object
TrafficLightStateMachine.StateGreen () (at Assets/Scripts/TrafficLightStateMachine.cs:41)
TrafficLightStateMachine.Update () (at Assets/Scripts/TrafficLightStateMachine.cs:36)

When I follow the error in Unity, it takes me to this line for the problem:

        if (target.GetGreenTime() > target.GetTime())

Any help would be greatly appreciated.

you never initialize “target”
all you have is GetComponent();
what you need is target = gameObject.GetComponent ();
@Olmstead

That did it, now it runs.
Thank you! @kalen_08