Can't find object reference of embedded class

Could somebody explain why that isn’t referenced??

	[System.Serializable]
	public class Triad{
		public int a = -1;
		public int b = -1;
		public int c = -1;
		
	}
public Triad[] dividedTris;

void devideTris(){
	dividedTris = new Triad[tris.Length/3];
	for(int i = 0; i < tris.Length; i += 3){
		Debug.Log(dividedTris*.a);*

_ dividedTris[i/3].a = tris*; //NullReferenceException: Object reference not set to an instance of an object*_
* dividedTris[i/3].b = tris[i+1];*
* dividedTris[i/3].c = tris[i+2];*
* }*
* }*

@Rudy, yep didn’t check properly, you’re right it’ll function ok; I still don’t like it though :wink:

I would suggest a new version (including Rudy’s but modified):

 [System.Serializable]
 public class Triad
 {
     public int a;
     public int b;
     public int c;
 
     public Triad(int a, int b, int c)
     {
         this.a = a;
         this.b = b;
         this.c = c;
     }
 }
 public Triad[] dividedTris;

 void devideTris()
 {
     dividedTris = new Triad[tris.Length / 3];
     int d = 0;
     for (int i = 0; i < tris.Length; i += 3)
     {
         dividedTris[d] = new Triad(tris*, tris[i + 1], tris[i + 2]);*

Debug.Log(dividedTris[d].a); //Note: we moved this line to follow after assignment, otherwise you’ll still get null ref
d++;
}
}