Fix segfault trying to create IfcSweptDiskSolid with invalid curve #5474

In my case it was IfcIndexedPolyCurve with just 1 vertex. Though kernel->convert does return a boolean value to indicate if conversion was successful, we never used it - so it failed silently leading to segfault later on.
Now we also stop processing those polycurves during mapping stage but checking kernel->convert result still might be useful in some other cases.
This commit is contained in:
Andrej730
2024-09-27 16:31:49 +05:00
parent fe3b66c044
commit 9f02737a2e
+4 -2
View File
@@ -95,8 +95,10 @@ namespace {
OpenCascadeKernel::curve_creation_visitor_result_type operator()(const taxonomy::loop::ptr& l) {
TopoDS_Wire wire;
kernel->convert(l, wire);
return result = wire;
if (!kernel->convert(l, wire)) {
throw std::runtime_error("Failed to convert loop to wire");
}
return result;
}
OpenCascadeKernel::curve_creation_visitor_result_type operator()(const taxonomy::edge::ptr& e) {