Handle the CollectionEditor error if the collection has null items
See the question and my original answer on StackOverflowIt depends exactly how you want to work around this, but if you just need to exclude the null values, then you can override the default ArrayEditor class, something like this;
// define the editor on the property
[Editor(typeof(MyArrayEditor), typeof(UITypeEditor))]
public Test[] test { get; set; }
...
public class MyArrayEditor : ArrayEditor
{
public MyArrayEditor(Type type) : base(type)
{
}
protected override object[] GetItems(object editValue)
{
// filter on the objects you want the array editor to use
return base.GetItems(editValue).Where(i => i != null).ToArray();
}
}