I am trying to add type of material objects to the array using below code but getting an error when one of the object is not available.
and the error is