I have this code in Unity in an custom inspector in the method OnInspectorGUI():
MyCustomMonoBehaviour mono = target as MyCustomMonoBehaviour;
List<Operation> myOperations = mono.operations;
myOperations.add(new Operation());
And I get this error, I don't know why:
> NullReferenceException: Object > reference not set to an instance of an > object MyTestEditor.OnInspectorGUI ()
Any idea?