diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 0d93faf3000..8e8808764ff 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -486,6 +486,9 @@ public: template void estimate_geodesic_distances(VertexDistanceMap vdm) { + if(is_empty(tm)){ + return; + } double d=0; if(source_change_flag) { //don't need to recompute Mass matrix, cotan matrix or timestep reflect that in this function @@ -513,6 +516,9 @@ private: typename Traits::Compute_scalar_product_3 scalar_product = Traits().compute_scalar_product_3_object(); typename Traits::Construct_vector_3 construct_vector = Traits().construct_vector_3_object(); + if(is_empty(tm)){ + return; + } source_change_flag = false; CGAL_precondition(is_triangle_mesh(tm));