Get Count of a List inside a List / Class


I am trying to check the count of a list which is inside another list, but can’t seem to quite get it.

Here is an example:

var waypointPositionsList = List.<WayPointsClass>();

class WayPointsClass
	var Id : String;
	var wayPointPosition : List.<Vector3>;

		if(waypointPositionsList[0].wayPointPosition.Count > 2)
//Do Stuff

Gives me:
NullReferenceException: Object reference not set to an instance of an object
listOfLists.PlotWayPoint ()

Any ideas?


Thats because wayPointPosition is not set, its null

You need a constructor for it