From 74fa4ee92bc3d4fba6b315d768d3211d2fcb2a30 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 9 Dec 2021 13:54:34 +0100 Subject: Fix (unreported): missing null check A crash happened when `instance_id_attribute` further down in the function was null. This issue was probably introduced when the id attribute starting using generic attribute handling. --- .../nodes/geometry/nodes/legacy/node_geo_legacy_point_instance.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender') diff --git a/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_instance.cc b/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_instance.cc index ef35bef96aa..c8d9a6e9c7c 100644 --- a/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_instance.cc +++ b/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_instance.cc @@ -173,6 +173,9 @@ static void add_instances_from_component(InstancesComponent &instances, const AttributeDomain domain = ATTR_DOMAIN_POINT; const int domain_size = src_geometry.attribute_domain_size(domain); + if (domain_size == 0) { + return; + } VArray positions = src_geometry.attribute_get_for_read( "position", domain, {0, 0, 0}); -- cgit v1.2.3