Reset and arrays.

When I click Reset in Inspector the array is created/resized with 4 elements.
But I can’t modify its values. I get the error:
NullReferenceException: Object reference not set to an instance of an object

What am I doing wrong?

  [System.Serializable]
  public class Product{
       public string nombreID;
  } 
        
 public class Shop : MonoBehaviour {
        public Product[] consumibles;
        
        public void Reset(){
        	consumibles = new Product[4];
        	consumibles[0].nombreID = "coins_1000";
        }
 }

The array is initialized but objects in it aren’t. You have “pointers to objects” but those objects doesn’t exist. After you’ve initialized your array you need to initialize a new Product in that place:

consumibles[0] = new Product();