NullReferenceException: Object reference not set to an instance of an object

[HideInInspector]
public Transform blue;
[HideInInspector]
public Transform green;
[HideInInspector]
public Transform orange;
[HideInInspector]
public Transform purple;
[HideInInspector]
public Transform red;
[HideInInspector]
public Transform yellow;

public Transform FindChild(  GameObject parent, string name)
	{
		if (parent.name == name)
		{
			Debug.Log("Parent's Name is same as you are searching for");
			return null;
		}

		Transform pTransform = parent.GetComponent<Transform> ();
		foreach (Transform t in pTransform)
		{
			if (t.name == name) 
			{
				return t;
			}
		}
		return null;
	}


	public void FindItemsObjects()
	{
		_blue = GameObject.FindWithTag ("Blue");
		WhenYouDoSomething (_blue, blue, blueScale);

		_green = GameObject.FindWithTag ("Green");
		WhenYouDoSomething (_green, green, greenScale);

		_orange = GameObject.FindWithTag ("Orange");
		WhenYouDoSomething (_orange, orange, orangeScale);

		_purple = GameObject.FindWithTag ("Purple");
		WhenYouDoSomething (_purple, purple, purpleScale);

		_red = GameObject.FindWithTag ("Red");
		WhenYouDoSomething (_red, red, redScale);

		_yellow = GameObject.FindWithTag ("Yellow");
		WhenYouDoSomething (_yellow, yellow, yellowScale);
	}

	public void WhenYouDoSomething(GameObject item, Transform itemTransforms, Vector3 itemScale)
	{
		Debug.Log ("This is when");
		if (item == null)
			Debug.Log ("Item is null");
		else
		{
			itemTransforms = FindChild ( item, "line");
			itemScale = itemTransforms.localScale;
		}

	}
void Start()
	{
		FindItemsObjects ();

	}

It’s telling me that blue green orange purple red yellow not NullReferenceException: Object reference not set to an instance of an object

But I dont want to put objects in inspector, also I need them public since Im accessing from another script

First, you can make accessors so you don’t have to see them in inspector:

 public  Transform green {get; private set;}

And you probably need a null check at line 63:

if(itemTransforms!=null)
{
  itemScale = itemTransforms.localScale;
}

Your algorithm probably does not work as expected and you don’t get any results, so itemTransforms is null, yet you try to access a property from it (localScale).