Fix: Sample nearest surface node crash with empty mesh

This commit is contained in:
Hans Goudey 2022-10-18 10:07:32 -05:00
parent a2fcfcabd7
commit 91ecf47b2c
1 changed files with 5 additions and 1 deletions

View File

@ -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;