diff --git a/source/blender/makesrna/intern/rna_attribute.cc b/source/blender/makesrna/intern/rna_attribute.cc index e4466e406e0..1c222206710 100644 --- a/source/blender/makesrna/intern/rna_attribute.cc +++ b/source/blender/makesrna/intern/rna_attribute.cc @@ -399,6 +399,10 @@ static PointerRNA rna_AttributeGroup_new( CustomDataLayer *layer = BKE_id_attribute_new( id, name, eCustomDataType(type), AttrDomain(domain), reports); + if (!layer) { + return PointerRNA_NULL; + } + if ((GS(id->name) == ID_ME) && ELEM(layer->type, CD_PROP_COLOR, CD_PROP_BYTE_COLOR)) { Mesh *mesh = (Mesh *)id; if (!mesh->active_color_attribute) {