Skip to content

Commit

Permalink
Fix crash in MeshWarp when mesh is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
akenmorris committed Feb 8, 2024
1 parent bba5c11 commit d579534
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Libs/Mesh/MeshWarper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ bool MeshWarper::generate_warp() {
// prep points
this->vertices_ = this->reference_particles_;

if (reference_mesh_->GetNumberOfPoints() == 0) {
SW_ERROR("Unable to warp mesh, no points in surface mesh");
update_progress(1.0);
warp_available_ = false;
return false;
}

this->add_particle_vertices(this->vertices_);

if (this->landmarks_points_.size() > 0) {
Expand Down

0 comments on commit d579534

Please sign in to comment.