Optional List Parameter not working

Hi I’m having trouble using optional parameters and in this case a list.
Example:

Method([Optional] List optionalList)
{
GameObject test = new GameObject;
optionalList.Add(test );
}

There are no input errors, but when I run it with a method which doesn’t input the optionalist, it throws an error when test is added.

Solution:
It passes null if you don’t input anything, so just do a null check:
if (optionalList != null) optionalList.add(test);