MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.

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

public class ObjectPooler : MonoBehaviour
{

public GameObject pooledObject;

public int pooledAmount;

List<GameObject> pooledObjects;

// Use this for initialization
void Start()
{
    pooledObjects = new List<GameObject>();

    for (int i = 0; i < pooledAmount; i++)
    {
        GameObject obj = (GameObject)Instantiate(pooledObject);
        obj.SetActive(false);
        pooledObjects.Add(obj);
    }

}

public GameObject GetPooledObject()
{
    for (int i = 0; i < pooledObjects.Count; i++)
    {
        if (!pooledObjects*.activeInHierarchy)*

{
return pooledObjects*;*
}
}
GameObject obj = (GameObject)Instantiate(pooledObject);
obj.SetActive(false);
pooledObjects.Add(obj);
return obj;
}
}

Another Gameobject may be trying to locate the Script that has been destroyed. And since the script it’s trying to locate doesn’t exist anymore it displays that error message