diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-18 18:07:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-18 18:07:32 +0300 |
commit | 91ecf47b2c6b884aadb5550adeda03d5700988d4 (patch) | |
tree | 0fc4f9738b072e88c0dd6db283f7170147f10de8 /source/blender/nodes/geometry | |
parent | a2fcfcabd74294d261bc76ed18d6591e4b9ea8fb (diff) |
Fix: Sample nearest surface node crash with empty mesh
Diffstat (limited to 'source/blender/nodes/geometry')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc index 44851a0ade5..95bf7199d63 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc @@ -240,7 +240,11 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_default_remaining_outputs(); return; } - if (mesh->totpoly == 0 && mesh->totvert != 0) { + if (mesh->totvert == 0) { + params.set_default_remaining_outputs(); + return; + } + if (mesh->totpoly == 0) { params.error_message_add(NodeWarningType::Error, TIP_("The source mesh must have faces")); params.set_default_remaining_outputs(); return; |