New to unity/scripting: How can I update the size of my Gameobject Array so that it will not include missing prefabs/Gameobjects?

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

public class Addonclick : MonoBehaviour
{
    public List<GameObject> prefabs;
    public Transform[] spawnLocations;
    public RaycastHit hit;
    public Ray ray;
    public float YAxisAngle;

    void Start ()
    {
		
	}
	
	private void Update ()
    {
        if (Input.GetMouseButtonDown(0))
        {
            ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray, out hit, 100))
            {
                hit.rigidbody.gameObject.tag = "Painting";
                Destroy(hit.rigidbody.gameObject.GetComponent<PaintingLife>());
                addtoArray(hit.collider.gameObject);
                Debug.Log(prefabs);
                //hit.rigidbody.gameObject.transform.position = new Vector3(0, -100, 0);
                hit.rigidbody.gameObject.SetActive(false);
                hit.rigidbody.gameObject.GetComponent<PaintingLongLife>().enabled = (true);
                //Destroy(hit.rigidbody.gameObject);
                //Debug.Log(hit.collider.gameObject.name);
            }
        }

        if (Input.GetMouseButtonDown(2))
        {
            instantiateList();
        }
    }

    void addtoArray(GameObject obj)
    {
        prefabs.Add(obj);
    }

    void instantiateList()
    {
        for (int i = 0; i < prefabs.Count; i++)
        {
            prefabs*.SetActive(true);*

Instantiate(prefabs*, spawnLocations[0].transform.position, Quaternion.Euler(-90, YAxisAngle, 0));*

}
}
}

you can check if prefabs is null, try prefabs.Remove (name); or prefabs.RemoveAt (_listCntr);