Strange, i cannot figure out this : "Object reference not set to an instance...

“Object reference not set to an instance of an object”?

here is the code:

var SystemAssetList : List.<String>;
        
 function GetList(){
        var AssetList : String[];
	AssetList=Directory.GetFiles(Application.dataPath+"/Bundles/");

	for(i=0;i<AssetList.length;i++){
	       SystemAssetList.Add(AssetList[i]);
	}
}

both vars are type String…why it gives me this error?

Your top line where you intialize the List , you forgot to intialize it. ().

var SystemAssetlist : List. = List.();

you are right! thank you!