"Object reference not set to instance of object" but it is

I have tried to import some component from another program to my game but it generated errors.
I imported it using the export on the other game and importing the package from my game.

NullReferenceException: Object reference not set to an instance of an object
InfiniteTerrain.Awake () (at Assets/RandomTerrain/Scripts/InfiniteTerrain/InfiniteTerrain.cs:81)

Line 81:


it also generated the same error on the infinite water script in this line:
m_waterGrid[i, j].transform.parent = InfiniteTerrain.m_terrainGrid[i, j].transform;
I don’t know where or what am i suppose to attach the object to.
It used to word fine for me but the water didn’t work so i imported it again and now it’s all broken.
Perhaps there is something i didn’t import?
Please help me.

My guess is that index i of m_splatPrototypes is NULL - since the error says that the referenced object is null (NullReferenceException). And the same would go for the other line - one of the arrays’ elements is NULL.