Object Reference Not Set To An Instance Of An Object
The line, audioRefList[i] = ....., is the one where the error appears on. audioRefList and audioList are both string[]'s that are declared at the top of the class. rtbOrder is a richtextbox.Code:private void SetAudioList() { audioList = rtbOrder.Lines; for (int i = 0; i < audioList.Length; i++) { audioRefList[i] = (Application.StartupPath + @"\AudioFiles\" + audioList[i]); } }
EDIT
I solved the problem by adding this line of code:
The reason i didnt set the array in the first place is because i thought i didn't have the ammount of items it was going to contain.Code:audioRefList = new string[rtbOrder.Lines.Length - 1];




Reply With Quote