Weird Error With References

Here is the code:

foreach (GameObject go in Dependencies)
            {
                BossDependency dep = Instantiate(go, transform.position, transform.rotation).GetComponent<BossDependency>();
                existingDependencies.Add(dep);
                dep.BossObject = this;
            }

The main issue is that it just throws an Object reference not set to an instance of an object error and stops the foreach loop. I tried using Debug.Log(dep) but it shows that it exists.

Nevermind, I figured it out, its just a simple mistake of me not doing this:

Original:

List<BossDependency> existingDependencies;

After:

List<BossDependency> existingDependencies = new List<BossDependencies>();

I was looking in the completely opposite direction, I hope unity could make the error message clearer by saying what value was not referenced.