C# Children and SubChildren Null Reference Exception

Hi everyone, in one of my scripts I’m getting a null reference exception and I’m trying to figure out why. The console says it’s coming from line 9. I have two Transform Arrays someTransformArray1 and someTransformArray2. Both of them have children and subchildren. I want to make it so someTranformArray1’s subchildren’s sharedMesh equals someTranformArray2’s subchildren’s sharedMesh. Any idea what is causing this null reference exception?

public Transform[] someTransformArray1;
public Transform[] someTransformArray2;

void Awake(){
	foreach (Transform child1 in someTransformArray1)
	foreach (Transform child2 in someTransformArray2)
	foreach (Transform subchild1 in child1)
	foreach (Transform subchild2 in child2)
	subchild1.GetComponent<MeshFilter>().sharedMesh = subchild2.GetComponent<MeshFilter>().sharedMesh;

Add an

if(subchild1 != null && subchild2 != null)

right above line 9, and you will be dandy. (It wont change the fact that this does not find any subchild1/2 in childCurrent or childOriginal, but it will get rid of that error)

Also, you seem to be running a cycle in a cycle in a cycle in a cycle. Are you SURE that’s what you wan’t to be doing?