Keep getting this error on different Text boxes. Any help would be appreciated!

NullReferenceException: Object reference not set to an instance of an object textHolder+c__Iterator1.MoveNext () (at Assets/Script/textHolder.cs:27) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) textHolder:Start() (at Assets/Script/textHolder.cs:19)

The code:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class textHolder : MonoBehaviour {

public string talking;
private TextManager TMan;

public float speed = 0.1f;
//public string fullText;
//private string currentText = "";

public string[] talkingLines;

// Use this for initialization
void Start () {
	TMan = FindObjectOfType <TextManager> ();
	StartCoroutine(ShowText());
}

IEnumerator ShowText(){
	for (int i = 0; i < talkingLines.Length; i++) {

		talking = talkingLines*;*
  •   	this.GetComponent<Text> ().text = talking;*
    
  •   	yield return new WaitForSeconds (1);*
    
  •   }*
    
  • }*

  • // Update is called once per framea*

  • void Update () {*

  • }*

  • void OnTriggerStay2D (Collider2D other)*

  • {*

  •   if (other.gameObject.name == "Player")*
    
  •   {	*
    
  •   	if (Input.GetKeyUp (KeyCode.Space))* 
    
  •   	{*
    
  •   		//TMan.ShowBox (talking);*
    
  •  		if (!TMan.talkingActive)*
    
  •   		{*
    
  •   			TMan.talkingLines = talkingLines;*
    
  •   			TMan.currentLine = 0;*
    
  •   			TMan.showTalking ();*
    
  •   		}*
    
  •   	}*
    
  •   }*
    
  • }*
    }

I believe it has something to do with scripts detecting certain components. Check that you dont have any deleted scripts on objects and or dont have a public game object or component that isnt assigned to a script. I’m not completely sure that is how to fix it, but I hope this helps.